from pymysql import connect
def main():
#创建Connection连接
conn = connect(host = 'localhost',port = 3306,user = 'root' ,password = 'hezhuang',database = 'TCL',charset = 'utf8')
# 获得Cursor对象
cursor = conn.cursor()
#插入十万条数据
for i in range(100000):
corsor.execute("insert into text_index values('ha-%d')"%i)
#提交数据
conn.commit()
if __name__ == '__main__':
main()