Mysqldump script blocking data access for site


I recently setup the script found at:

When I run the script, the site that is currently being dumped becomes unresponsive until it completes. My largest db is only 12MB, but it still made the site unresponsive for more than a minute. Does a dump place a lock on the entire database, or table when it runs? Is there someway around this?


it can. there should be an option to lock tables. you may want to turn that off, but if your DB is written to whilst you are backing up, then your backup may be inconsistent. the other option is to put your website into maintenance mode during the dump.


I found the --single-transaction switch in mysqldump helped when the same thing happened to me…