DelphiFAQ Home Search:
General :: Databases :: mysql
General information about mysql - how to get around the differences between version 3.33 an 4, how to do stuff that you think you need a nested query for etc.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

Lock an entire mysql database with all its tables

Question:

How can I lock my entire mysql database? And how can I lock a single table?

Answer:

Go to the mysql shell and use the FLUSH command.
This clloses all open tables and locks all tables for all databases with a read lock until you execute UNLOCK TABLES. This is very convenient way to get backups.

FLUSH TABLES WITH READ LOCK;
 
 /* alternatively lock a single table:
 LOCK TABLES customers READ; 
 */
 
 /* running my backup */
 
 UNLOCK TABLES;

Generated 4:00:52 on Mar 24, 2019