DelphiFAQ Home Search:

Lock an entire mysql database with all its tables

 

comments16 comments. Current rating: 4 stars (6 votes). Leave comments and/ or rate it.

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;

Content-type: text/html

Comments:

You are on page 2 of 2, other pages: 1 [2]
2017-08-24, 02:53:07
anonymous  
Tersesat pengisap ayam kampung inchi indonesia.
You are on page 2 of 2, other pages: 1 [2]

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: