#连接
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/

相关文章:

  • 2021-08-07
  • 2021-08-29
  • 2022-03-08
  • 2022-12-23
  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
猜你喜欢
  • 2022-12-23
  • 2021-09-30
  • 2021-09-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
相关资源
相似解决方案