from sqlalchemy import create_engine import pandas as pd connect = create_engine('mysql+pymysql://root:123456@xxx.xxx.xxx.xxx:3306/xxx?charset=utf8') df=pd.read_excel(r"文件地址", header=0) #读取数据 pd.io.sql.to_sql(frame=df,name='table_name',con=connect,if_exists='append',schema='database',index=False)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)