Blog

Blog

Backup All Databases From MySQL Server

Under: Web Development - July 25th, 2010

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:
Comments (0)

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URL

Sorry, the comment form is closed at this time.