• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

MySQL Read Only

November 22, 2020

Here’s how to make a MySQL database read only.

mysql> FLUSH TABLES WITH READ LOCK;
mysql> SET GLOBAL read_only = ON;

mysql> FLUSH TABLES WITH READ LOCK; mysql> SET GLOBAL read_only = ON;

It’s very useful if creating a replica database.

Filed Under: Linux Tagged With: mysql, read-only

Search This Website

Subscribe Via Email

  • Home
  • About
  • Archives

Copyright © 2023