Backing up all MySQL Databases

The following command run from SSH will backup and gzip all mySQL databaes and place them inot the /home directory:

mysqldump --add-drop-table --all-databases | gzip > /home/alldatabases.sql.gz

To restore all the databases if needed later, run the following command assuming the original gzip file is in the orriginal location:

gunzip < /home/alldatabases.sql.gz | mysql -u root

  • 7 Users Found This Useful
Was this answer helpful?

Related Articles

Rebooting my server

Your server will be running CentOS 5+. To reboot the server you can run the following command...