Blog

Blog

25
Jul
2010

Backup All Databases From MySQL Server

Its always good to keep your MySQL server backed up regularly.

However if you need to backup the entire server with all databases at once here is what you do

$ mysqldump --all-databases -p | bzip2 -c > databasebackup.sql.bz2
Enter password:

This will save a bz2 file with all the databases.

To restore the databases back use the following (take care not to restore it to a server with the same table names – it may corrupt your data)

$ mysql -p < databasebackup.sql
Enter password:

No comments yet.

Sorry, the comment form is closed at this time.