import pymysql
def get_db_engine_target():
db_dict = {'host': '1127.0.0.1',
'user': 'root',
'password': 'root',
'port': 3306,
'database': "aaabbb",
"charset": "utf8"
}
conn = pymysql.connect(**db_dict)
return conn
sql = "select * from table;"
data = pd.read_sql(sql, get_db_engine_target())