How to enable autocommit in python-mysql integration using mysql.connector?

Viewed 27

I am working on a python project using mysql database integration by mysql.connector package. I want to turn on autocommit but dont know how to do that. This is how I connected with mysql:

mydb = mysql.connector.connect(
    host="localhost",
    user="root",
    passwd="admin"
)

Please tell me how to turn on autocommit if you know so.

1 Answers
Related