Header-Ad

PHP,Joomla,WordPress & Linux based server management, error resolutions and fixing problems.

Thursday, November 17, 2016

Export & Import all mysql databases at one time.



Most of the times you want to keep a backup of all of your MySQL databases. Suppose you have more than 100 MySQL databases & you want to export all of them at the same time and again import all of them into MySQL server at one time. How would you do that?

The answer ....


Go to the command line : 

How to export all mysql databases at once:

mysqldump -u root -p --all-databases > alldb.sql
Edit the root and enter the password for root to export all the databases to alldb.sql file, notice that this file will be generated at the same place where you are working in shell from.

How to Import all mysql databases at once:

mysql -u root -p < alldb.sql
Edit the user root if necessary and enter the password for root to import all the databases from alldb.sql file to mysql.


Good luck!!

, ,