Thursday, November 24, 2011

MySQL dump without locking tables

If you just do MySQL dump without any parameters, it locks tables and consumes a lot of memory. If you want to avoid it and you have InnoDB, best way to do it is to add single-transaction (run in single transaction) and q (dump one row at once) properties, for example like:

mysqldump -q --single-transaction -u login -ppassword db > dump.sql


No comments:

Post a Comment