Jump to content

MySQL import certain database in a large sql file.


xenophobia

Recommended Posts

Okay, I've done this:

mysqldump --all-databases -u root > mysql.sql

 

So this sql file had all the databases. So now I wanted to import to another machine.

 

My question now is, how do I import certain database only from this sql file?

I tried this:

mysqlimport -u root mydb mysql.sql

I got:

mysqlimport: Error: Unknown database 'mydb'

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.