Created
September 20, 2016 02:20
-
-
Save ytkhs/72aca7efa711f0f2d2a380bf9de99baa to your computer and use it in GitHub Desktop.
MySQLを読み取り専用にする(バックアップ時など)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 読み取り専用にする | |
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
https://dev.mysql.com/doc/refman/5.6/ja/replication-solutions-backups-read-only.html