Commit 1a24af8e authored by 高雅喆's avatar 高雅喆

add df_to_tidb.py

parent 3203f457
# -*- coding: UTF-8 -*-
#把文件写到线下测试tidb
import pandas as pd
from sqlalchemy import create_engine
df = pd.read_excel("ios.xlsx")
engine = create_engine("mysql+pymysql://{user}:@192.168.15.12:4000/{db}"
.format(user="root",
db="jerry_test"))
df.to_sql(con=engine, name='ios_meitu', if_exists='replace')
#把文件写到线上正式tidb
import pandas as pd
from sqlalchemy import create_engine
df = pd.read_excel("ios.xlsx")
engine = create_engine("mysql+pymysql://{user}:{pw}@10.66.157.22:4000/{db}"
.format(user="root",
pw="3SYz54LS9#^9sBvC",
db="jerry_test"))
df.to_sql(con=engine, name='ios_meitu', if_exists='replace')
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment