I have a requirement for a newly added DB in MySQL instance to have READ-COMMITED as the transaction isolation level. While the rest of the DBs require the default REPEATABLE-READ.
I am trying to leverage init_connect system variable to check incoming session and based on that setting the transaction-isolation at session level.
Added below line to my.cnf and restarted the service and I can see it is reflecting post reboot, but when i logged in as test user i still see default transaction isolation which means my condition in init_connect is not working. What am i doing wrong here
init_connect = "SET @@transaction_isolation = CASE CURRENT_USER() WHEN '[email protected]' THEN 'READ-COMMITTED' ELSE @@transaction_isolation END;"
Thanks