I didn’t read the code carefully, but the obvious problem is that there is no commit transcation after the insert statement’s executeinsert语句的execute之后没有commit transcation
解决方法:
在cur.execute('insert into ipList(ipList) values(%s)', ip_list[j])
Solution:
Add 🎜 in the next line of cur.execute('insert into ipList(ipList) values(%s)', ip_list[j])
If there is no exception, then it must be the InnoDB engine used for the database, right? You have to commit the transaction. After executing all the statements, add conn.commit()Try
I didn’t read the code carefully, but the obvious problem is that there is no
commit transcation
after theinsert
statement’sexecute
insert
语句的execute
之后没有commit transcation
解决方法:
在
cur.execute('insert into ipList(ipList) values(%s)', ip_list[j])
Solution:
Add 🎜 in the next line ofcur.execute('insert into ipList(ipList) values(%s)', ip_list[j])
If there is no exception, then it must be the InnoDB engine used for the database, right?
You have to commit the transaction. After executing all the statements, add
conn.commit()
TryAfter inserting, you can use the command line to query or insert to see whether the database will be locked. . Just know if the matter is not over yet
Or turn on automatic submission
conn.autocommit(True)