2

I have a MySQL 5.7 installed on my system which is set with default transaction isolation level "REPEATABLE-READ". My scenario requires "READ-COMMITTED". So I changed the isolation level in the configuration file so that I can have "READ-COMMITTED" as default.

Yes, on adding it to configuration file, I can see isolation level was changed at global level but it remains "REPEATABLE-READ" at session level. I think anything that got changed in the file should be set across global and session levels as soon as I restarted the server. But this isn't changing.

Please help me regarding this.

Yashwanth Aluru
  • 1,125
  • 6
  • 21
  • 28
  • How are you connecting to the db? Isn't your script/library setting the session variables upon connect? – Marki555 Jun 15 '16 at 11:24
  • @Marki555 No, they don't. I just want to know why the values are not changing when I edited the configuration file – Yashwanth Aluru Jun 15 '16 at 12:03
  • If `show global variables like 'tx_isolation';` shows correct value, then your config is working fine. You can also check with `mysql --verbose --help|grep isolation` - it will show you what value mysqld uses when starting up. – Marki555 Jun 15 '16 at 12:45
  • @Marki555 yes it does. But if I execute `show session variables like 'tx_isolation';` for a new session, I see "REPEATABLE-READ" by default. Can't we change this? – Yashwanth Aluru Jun 16 '16 at 08:40
  • 1
    Does it happen also when connecting via mysql command-line client? – Marki555 Jun 16 '16 at 20:05
  • @Marki555 No! It happens when connected via Workbench only. Through command line it shows READ-COMMITTED in both session and global levels. – Yashwanth Aluru Jun 17 '16 at 09:02
  • So some settings in Workbench are causing it to set the session variable upon connect. – Marki555 Jun 17 '16 at 13:37

1 Answers1

0

This following set query working for me in both session and global also.

SET GLOBAL tx_isolation='READ-COMMITTED'

Again when I check the level using the following query it will return the updated value.

SELECT @@global.tx_isolation,@@tx_isolation;

I hope this will help.

Gomzy
  • 431
  • 4
  • 14