Magento Admin Tip: Run mysqldump Without Locking Tables

By August 29, 2011Magento, Web Development

Magento Admin Tip: Run mysqldump Without Locking Tables

Ron Peled 4:12 pm

Hey all Magento administrators or developers out there, just a short tip here on how to avoid locking tables when you perform a full mysqldump on a live server. This does not apply for any shared hosting, but only the more advanced dedicated hosting (VPS/cloud or not). When you perform a mysqldump on a live environment, the default behaviour is to lock the entire set of tables until the dump is complete, even if it takes 1 minute or less, it means that during that minute, users will not be able to checkout, or admins may not be able to perform any transactions in the back end.

So, all that is needed is to add this simple option at the command line when running mysqldump: –lock-tables=false. I just tried it on a live environment which receives more than 3K visitors daily and it worked great.

Happy Coding!

Related Posts:

Ron Peled

About Ron Peled

Builder of things. Builder of teams. Passion: eCommerce & Marketplaces. Magento expert. CTO Mentor.