xenophobia Posted November 26, 2009 Share Posted November 26, 2009 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' Quote Link to comment https://forums.phpfreaks.com/topic/182978-mysql-import-certain-database-in-a-large-sql-file/ Share on other sites More sharing options...
fenway Posted November 26, 2009 Share Posted November 26, 2009 If the file is a reasonable size, you can extract the field in a text editor -- otherwise, sed and grep are your friends. Quote Link to comment https://forums.phpfreaks.com/topic/182978-mysql-import-certain-database-in-a-large-sql-file/#findComment-965914 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.