pymysql dataframe 写入sql
import pandas as pd
import pymysql
from sqlalchemy import create_engine
#engine = create_engine("mysql+pymysql://user:password@host:port/databasename?charset=utf8")
engine = create_engine("mysql+pymysql://root:08300734@127.0.0.1:3306/lgttcc?charset=utf8")
import tushare as ts
df=ts.get_hist_data('000001')
df.to_sql(name = 'stock',con = engine,if_exists = 'append',index = False,index_label = False)