0

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?

  • I created these new databases using phpmyadmin. – UNagaswamy Sep 15 '15 at 13:55
  • Unagaswamy, before mysqldump did you checked mysql >show databases ; what it show. – Md Haidar Ali Khan Sep 15 '15 at 14:54
  • mysql>show databases does show all the new databases. – UNagaswamy Sep 15 '15 at 15:16
  • have you checked in root user privilege of your new created database or not – Md Haidar Ali Khan Sep 15 '15 at 15:20
  • sorry, I don't understand the question! Are you asking if the root has privileges on the new databases? If so, yes, the root does! – UNagaswamy Sep 15 '15 at 15:26
0

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.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.