Skip to content

Instantly share code, notes, and snippets.

@KestindotC
Created November 24, 2017 03:00
Show Gist options
  • Save KestindotC/e2f70dbe1039141df8a5ccd15badff33 to your computer and use it in GitHub Desktop.
Save KestindotC/e2f70dbe1039141df8a5ccd15badff33 to your computer and use it in GitHub Desktop.
RDS connection with python application
import pymysql
import pandas as pd
from sqlalchemy import create_engine
engine = create_engine('mysql+pymysql://kestin_chang:<password>@<RDS-endpointURL>:3306/<DBname>')
# Pandas read_sql function
df = pd.read_sql_query('SELECT * FROM <TABLE NAME> LIMIT 10',engine)
# Print result
print(df.head())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment