Can I import a single MySQL database using a mysqldump?

1153210 pts.
Tags:
Database
MySQL
mysqldump
Does anyone if it would be possible to actually import a single database from an all databases mysqldump? I've already tried modifying the file manually but it didn't work. Are there any command line options to do this? We're removing a ton of databases but we need the option to restore one if need be. Thank you!
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

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.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: