Fully-Faltoo blog by Pratyush

Bio Twitter Screener

27th Dec. 2012

Dump and restore all MySQL databases in one command

Came across this wonderful discussion on StackOverflow, for dumping all the MySQL databases from command line.

For dumping:

mysqldump -u username -p --all-databases > alldbs.sql

For restoring:

mysql -u username -p < alldbs.sql

The advantage is that it is very quick, and you do not lose the user privileges.


Leave a comment

Your email will not be published.