0

I am trying to migrate a database from one cluster to another cluster. In order to avoid any data loss during the migration, I am trying to lock my database with the WRITE operations. But the lock command from mysql doc

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

will lock the entire database which means this will lock other databases which I don't own and I don't want to lock other databases. Is there a way to lock only specific databases on a shared mysql instances.

Thanks

rajkumarts
  • 103
  • 2

1 Answers1

0

Take a look at LOCK TABLES. You will need to list all tables in the database, but it should do what you expect.

Fox
  • 3,887
  • 16
  • 23