Created
November 24, 2017 03:00
-
-
Save KestindotC/e2f70dbe1039141df8a5ccd15badff33 to your computer and use it in GitHub Desktop.
RDS connection with python application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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