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

  • Just revoke any user accounts that have write access to the database in question. – EEAA Nov 3 '15 at 22:31
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.