Skip to content

Instantly share code, notes, and snippets.

@openrijal
Created January 11, 2017 05:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save openrijal/b5d89b092c743bc273cb83605aeb2507 to your computer and use it in GitHub Desktop.
Save openrijal/b5d89b092c743bc273cb83605aeb2507 to your computer and use it in GitHub Desktop.
MySQL Transaction Isolation Level
##
# Set isolation level to READ-COMMITTED
# https://dev.mysql.com/doc/refman/5.6/en/set-transaction.html
##
SELECT @@GLOBAL.tx_isolation, @@tx_isolation;
SET GLOBAL tx_isolation='READ-COMMITTED';
SET SESSION tx_isolation='READ-COMMITTED';
##
# Set binlog to MIXED format
# http://dba.stackexchange.com/questions/6150/what-is-the-safest-way-to-switch-the-binlog-format-at-runtime/6753#6753?newreg=1e7f12bd452b4a93945c79402565e180
##
FLUSH TABLES WITH READ LOCK;
FLUSH LOGS;
SET GLOBAL binlog_format = 'MIXED';
FLUSH LOGS;
UNLOCK TABLES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment