#连接
engine = create_engine('mysql+pymysql://***:***@localhost:3306/test?charset=utf8')
# #读取
# ret = pd.read_sql_query("select * from testtable",engine)
# print(ret)
#写入
data0 = pd.read_excel('d:/综合信息查询_成交回报.xls')
print(data0)

ret2 = data0.to_sql('o32',engine,if_exists='append')
print(ret2)

 

中文

create_engine的时候在后边加上 ?charset = utf8

http://firefish.blog.51cto.com/298258/112794/

posted on 2017-02-07 10:57  ppqchina  阅读(2448)  评论(0编辑  收藏  举报