Sunday, August 14, 2011

how do i install a database dump into another database

Qs.i have a new database called 'jabb' and i want install the dump file 'sample.sql' into it?.. ive tried mysqldump --opt jabb > sample.sql but when i chek jabb, there aren't no tables.. do i still have to make the tables before dumping?

Ans:
mysqldump jabb -u [username] -p > sample.sql
Should export the table jabb from mysql to SQL syntax in a file called sample.sql. (if this isn't what you wanted to do you may have to get a fresh file.) open this file:

gedit sample.sql (I'd use vim sample.sql)

And check that the file contains the table.

The command for importing a dump is something like

mysql jabb -u[username] -p < sample.sql

If that doesn't work then I think you must not have mysql users set up correctly (check out the mysql manual - it's actually

Source: http://ubuntuforums.org/showthread.php?t=598130

No comments:

Post a Comment