Skip to content

Instantly share code, notes, and snippets.

@mrsweaters
Created January 26, 2016 19:34
Show Gist options
  • Select an option

  • Save mrsweaters/3a9f1ca8c1c381f58620 to your computer and use it in GitHub Desktop.

Select an option

Save mrsweaters/3a9f1ca8c1c381f58620 to your computer and use it in GitHub Desktop.
Set MySQL to read-only
FLUSH TABLES WITH READ LOCK;
SET GLOBAL read_only = 1;
# and back to normal mode with:
SET GLOBAL read_only = 0;
UNLOCK TABLES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment