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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mySQL Export specific table(s) to import elsewhere

Status
Not open for further replies.

BigC72

MIS
Oct 15, 2004
69
US
More than relatively new to mySQL....Trying to facilitate a table export on a number of tables in one DB so that they can be imported into another DB. The command line command I've been using looks like this:

mysqldump -u root -pbigcountry dbname table_name > table_name.sql

It doesn't seem to care for this command...Can anyone enlighten me as to why? Also since I'm having no luck with exporting what would be the correct syntas to then import this file back into another DB?

Thanks in advance for any help or insight!
 
It doesn't seem to care for this command...
That is not much to go along with. What happens really?

+++ Despite being wrong in every important aspect, that is a very good analogy +++
Hex (in Darwin's Watch)
 
Sorry...to be specific the cursor simply drops to the line below and sits there with no indication that anything has been done...I thought possilby it might be just generating the file so I left it for over 20 minutes and saw the same thing when I returned to it. Backing up the entire DB took only a few seconds so I just assumed (bad word I know) that a singular table export would be equally as quick.
 
You say it jumps to the next line something like
C:\....\bin\>_

or just the cursor: _

IF iots the first thne it s done and you need to look for the table_name.slq file it has just created.

If its the second one. then its hanging up somewhere.


As for the syntax to import, that would depend on what type of DB you are importing into.

Since the mysqldump generates a file with sql commands to recreate the table, you can just feed back into the promp of the other DB.

such as:

mysql -u root -p < table_name.sql





----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
It's actually the second example vacunita...which leads me to believe as you said that it's hanging up...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top