Running mysqldump in a live database

Just wanted to know what are the risks of running mysqldump in a live database? Are there any chances of database corruption? mysqldump locks the entire database.

+4
source share
2 answers

What engine do your database tables use? If you use transactional tables, you can reset using the "single-transaction" option, which will reset your tables in a consistent state. If you use tables like MyISAM that are not transactional, you should have no problem with database corruption. However, you may have inconsistent data problems if you end up in a race scenario. In any case, you will drastically slow down the database response time until a dump occurs. It is best to start the dump with the slave or wait until the site is at a standstill before starting the dump.

+2
source

in my experience, this is a table lock on reset. If your database is at the big end and you have heavy traffic, you will get significant return traffic. I do not think that data corruption would be a problem as it locks the table before flushing the data of this table. But if I am mistaken in locking tables and this is locking the database, then you basically disabled your database during the dumping process, but for this queue, when dumping is complete, it will start executing the queue in the order they received.

0
source

Source: https://habr.com/ru/post/1398238/


All Articles