Not Just Paranoid

Another site by Pete Maynard

MySQL Backup/Restore database

The following command will back up your MySQL database to a file.

mysqldump --add-drop-table -u user -p database > outputfile.sql

The following will restore your database.

mysql -u root -p database < outputfile.sql

Or for a complete server back up and compression:

mysqldump -u root -p --all-databases | gzip > output.sql.gz

18 Dec 2011 | Tags ( backup MySQL )

Website Last Updated on 4 Oct 2024 (CC BY-SA 4.0)

This site uses JQuery and nanogallery2 hosted by jsdelivr.net
for the Flickr photo feed and GoatCounter for user insights.