Import single database from --all-databases dump

mysqldump output is just a set of SQL statements.
You can provide the desired database in the command line and skip the commands against the other databases using:
mysql -D mydatabase -o < dump.sql
This will only execute the commands when mydatabase is in use
You can add --disable-keys for avoid errors of foreign keys.
mysql -u user -D --disable-keys database -o <dump.sql

No comments:

Post a Comment