Forums

change the ISOLATION LEVEL mysql

I need to change the ISOLATION LEVEL from REPEATABLE-READ to READ-COMMITTED. I try doing the following:

SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;

But I get the following error:

ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege (s) for this operation

How can I make the change?

You can't change the global isolation level. Just change it for the session: https://dev.mysql.com/doc/refman/5.7/en/innodb-transaction-isolation-levels.html

Thanks!

In my process, with MySQLdb, I have done:

db= MySQLdb.connect(host=host, user=user, passwd=passw, db=database)
cursor = db.cursor()
cursor.execute("SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED")
cursor.close()

[edited by admin: formatting]

great! glad you were able to fix it!