0

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

1 Answer 1

2

You need to commit the changes to the database with:

cursor.commit()

Otherwise they will reset when the cursor gets deleted.

Sign up to request clarification or add additional context in comments.

1 Comment

Let me try it but I am starting to remember that it is the right one. A very warm thanks bro!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.