用python在mysql里插入大量数据
Host="127.0.0.1"user="root"pwd='123456'port=3306database='demo'conn=pymysql.connect(host=Host,user=user,password=pwd,port=port,db=database)cursor=conn.cursor()for i in range(1,1000):data=cursor.execut
·
Host="127.0.0.1"
user="root"
pwd='123456'
port=3306
database='demo'
conn=pymysql.connect(host=Host,user=user,password=pwd,port=port,db=database)
cursor=conn.cursor()
for i in range(1,1000):
data=cursor.execute(f"insert into netease_user (fName,passwd,fID) values ('test{i}','123456',{i})")
conn.commit()
更多推荐
已为社区贡献1条内容
所有评论(0)