All Linux HowTo's

Restore a single MySQL DB from a Dump using –all-databases

Share This:

The link below shows a simple way to restore one the MySQL database that you want from a dump that included all databases.

Extracting a Database From a mysqldump File

The good people who wrote that article (can) take credit for the following:

shell> sed -n '/^-- Current Database: `mydb`/,/^-- Current Database: `/p' dump.sql > mydb.sql

Where “mydb” is the name of the database that you want to extract. The above is a single line.

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *