Dump large mysql database
an engineer has a way to backup their database, I have an experience how to backup large mysql database. The challenge is monitor the process when backup is already done. I’ve been search on google, the forum usually give the suggestion using pv, here the link . But i don’t know how pv not works on my server. progress bar always zero percent when dump has been started.
So this simple way, maybe shortcut to monitor process dump large database.
Get Abi Wardani’s stories in your inbox
Join Medium for free to get updates from this writer.
First we run mysqldump to starting the dump process.
mysqldump -u root -px xxxxxxxxxxxxxx — databases your_database — flush-logs — result-file=backup.sql — log-error=error.log
mysqldump is command for dump, and dont forget always add this option — log-error=error.log , because we want to know if something happen, we get the error.
So we just waiting, and try to check with
ps ax|grep mysql
it will show the process list mysql, If dump still running, you will see the command still exist there. If dump process success, the error.log doesn’t appear on directory. But if it exist, you have to check it, because dump process is failed.
I know this not best approach to doing this, because we still don’t know how long the backup will be done. But maybe this simple think you can try. If you have a experience how monitor this case, maybe you can give a comment in section below :D .










