I tried to backup my database with mysqldump. I've done this on a live website also. Is there any chance that this command could ever break a website/database?
Mysql – Will a thesqldump ever break the database
MySQLmysqldump
Related Question
- Amazon RDS – Resolve Freezes During mysqldump
- MySQL – Why Does mysqldump Require DROP Command?
- Mysql – Importing MySQL tables from other database in live site with thesqldump can cause trouble
- MySQL – MySQLDump problems with large table
- MySQLDump with Ansible – How to Backup Database
- MySQL – mysqldump Writes to /tmp and /var/tmp Only
Best Answer
The
mysqldump
utility will not break your database.Read the source code for it and/or turn on the general query log while it's running and you'll see that what all it does it look.
But...
If you are using MyISAM, or if you fail to use the
--single-transaction
option, or you issue aFLUSH TABLES;
request from another connection while the backup is reading a large table, you stand a higher chance of stalling your web site because there are things that can happen to cause queries to block until the specific table or the entire backup is complete.And, if you do have serious corruption in your data,
mysqldump
stands a good chance of running into it, since it reads every row from every table by default, which means the server will be trying to read through the corruption and could crash. This is essentially true of any backup, of course.But directly and ordinarily and by most reasonable definitions, mysqldump cannot harm your database contents.