Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'undumping' a mysql file that has 2 databases in it

Status
Not open for further replies.

bonosa

Programmer
May 19, 2004
76
US
I know how to 'undump' a sql file which has tables specific to a database. Butif my sql file contains several databases (or even just one database) hwo do I stick it into mysql?

I tried mysql < file.sql since for the tables counterpart it is

mysql mydb < fileOfTables.sql

But I couldnt get my databases out into mysql.
How do I do this?

Thanks,
sb
 
You must write into file which tables belongs to which database

use nameoffirrstdatabase;
create table bla ....

use nameofanother database
create table bla2 ....

use nameofotherdb
create table bla3 ....


or if tables belongs to 1 database
you should run mysql like this

mysql -u username -p -D nameofdatabase < file.sql


gry online
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top