Mysql – Why is thesqldump not saving newly added databases

mysqldump

I am using the following command to backup all mysql databases in script that is run as cronjob.

mysqldump -u root -p'***' --all-databases > backupdb.sql

I have added new databases recently and I noticed that the new databases are not saved in the backupdb.sql. What am I missing?

Best Answer

1) check your last 10 lines of dump file

 tail dump.sql

it should show your dump file properly completed or not.

2) grep the database name in dump file

 cat dump.sql | grep newdb  

with the above 2 steps you can find is your backup is completed propery or not and the new database exists or not.