mysqldump question

Posted on 2011-09-27
Medium Priority
Last Modified: 2012-08-13
I have a question about mysqldump.  

I currently run a mysqldump script on my databases daily. One database is very large with blob data and the backup takes quite a while. During the backup we are still able to search update and insert into this database which is necessary at all times.

My question is.. Will mysqldump backup/dump data that is updated or inserted into tables after the mysqldump process is started?

If it does i would be concerned that a restore from the dump would be incomplete.

Say I have 5 tables. MysqlDump starts dumping and completes the first two tables and starts backing up the third table which is large and takes a while. In the mean time my application is still running and users are inserting and updating data which affects the first two tables that have already been dumped as well as the third which is still being dumped as well as the fouth and fifth table which haven't been dumped yet. This would make for an incomplete record for my application if table three, four and five dumps include the new data but tables one and two don't...
Question by:Ben720
LVL 24

Accepted Solution

johanntagle earned 1000 total points
ID: 36714168
mysqldump by default only locks the current table being backed up, so yes, you are likely going to get tables inconsistent from each other.  Using --databases or --all-databases option will lock and dump all tables a database at a time, which will enable a consistent state, but then you won't be able to do inserts.

Since you put MS OS as one of the zones for this question, I assume your database is on a Windows server, so no option for LVM snapshots.  Suggest you configure replication, then do the backup on the slave while replication is temporarily turned off.

There's also Percona Xtrabackup that does hot backup, but the Windows version is still in Alpha.  See http://www.percona.com/downloads/XtraBackup/XtraBackup-1.6/Windows-alpha/.

Author Comment

ID: 36719872
Was afraid of that. After some more googleing for backing up the database with out taking it offline I came across "MySQL Enterprise Backup" . It seems to have the ability to do a complete backup while the database is still online (selects/updates/inserts/ect..) then updates the backed up data with any changes made during the backup. Going to run some testing with it, I'll post back the results...
LVL 24

Assisted Solution

johanntagle earned 1000 total points
ID: 36720433
Oh yes forgot about that because I don't use it (I believe it's $5000/server?).  Anyway, it's what's Percona Xtrabackup is positioned against - see http://www.percona.com/software/percona-xtrabackup/

Assisted Solution

rwwff earned 500 total points
ID: 36812923
Replication can be a little intimidating to setup the first time, but its really not so bad; and once you have a replication server running, you can do any ole horrible thing to it that you might want without impacting the working server.

LVL 21

Assisted Solution

by:K V
K V earned 500 total points
ID: 36813167
I'd rather suggest to setup a slave and take a backup from there.
If you are using Innodb "--single-transaction" will help in taking the consistent snapshot.

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

588 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question