Wednesday 15 July 2020

Export and Import all MySQL databases at one time

https://stackoverflow.com/questions/9497869/export-and-import-all-mysql-databases-at-one-time

Export and Import all MySQL databases at one time

mysqldump -u root -p --all-databases > alldb.sql
Look up the documentation for mysqldump. You may want to use some of the options mentioned in comments:
mysqldump -u root -p --opt --all-databases > alldb.sql
mysqldump -u root -p --all-databases --skip-lock-tables > alldb.sql

Import:

mysql -u root -p < alldb.sql

No comments:

Post a Comment

Note: only a member of this blog may post a comment.