Import all MySQL databases at one time in seperate file for Backup

Table of Contents

Script

Commands

$ 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
Rajesh Kumar
Follow me
Latest posts by Rajesh Kumar (see all)
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x