Skip to content

Instantly share code, notes, and snippets.

@ytkhs
Created September 20, 2016 02:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ytkhs/72aca7efa711f0f2d2a380bf9de99baa to your computer and use it in GitHub Desktop.
Save ytkhs/72aca7efa711f0f2d2a380bf9de99baa to your computer and use it in GitHub Desktop.
MySQLを読み取り専用にする(バックアップ時など)
-- 読み取り専用にする
FLUSH TABLES WITH READ LOCK;
SET GLOBAL read_only = ON;
-- バックアップとかDBサーバの移設作業とか --
-- 元に戻す
SET GLOBAL read_only = OFF;
UNLOCK TABLES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment