Reputation: 1
I have been trying to use MySql with Python and I had been using mysql connector.
Whenever I use cursor to execute commands, it works while the script is running but when I run the script again, the changes I made are gone.
Please help! Thanks in advance
Upvotes: 0
Views: 59
Reputation: 24038
You need to commit the changes to the database with:
cursor.commit()
Otherwise they will reset when the cursor gets deleted.
Upvotes: 2