Backup MYSQL Database’s in 1 Minute or Less.

Backup MYSQL Database’s in 1 Minute or Less.

QUICK dive

Lets wrap this up, you are in an emergency and wish to quickly backup all your databases, you have no gui and are logged in via ssh or in any of your terminal based session, no worries, run the following command as a sudoer user.

mysqldump --all-databases > all_db.sql

This command will backup all of your databases into a single file called all_db.sql which you can now email, download or just move to ftp easily.

If you wish to backup a specific database then run the following command

mysqldump your_database > your_database.sql

Replace your_database with your database name and enter the command.

 

FINAL WORDS

You can use the unzip utility to zip the sql file and use mail command to instantly mail the file to your email for quick saving it quickly!

 

Pro Tip!

You can also backup specific databases separated by “,” and it will be saved in one single file. Forexample

mysqldump --databases your_first_db your_second_db your_third_db your_fourth_db > my_four_databases.sql

Replace your_first_db and so on with your databases names and the final file will be my_four_databases.sql ofcourse filename is as per your choice.

 

Good luck!

As rated by readers
[Total: 0 Average: 0]
0

Leave a Reply

avatar
  Subscribe  
Notify of