If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Import ONLY specific tables from a mysqldump

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-19-05, 14:10
dgtech dgtech is offline
Registered User
 
Join Date: Nov 2005
Posts: 1
Import ONLY specific tables from a mysqldump

Hello,

How would I import only specific tables from a mysqldump I've done from another server? The database name I am importing to is "sgmail" and the tables I want to use are arp3_cam and arp3_bat.

Thanks and God Bless!

David Garza
Reply With Quote
  #2 (permalink)  
Old 12-21-05, 22:03
localhost localhost is offline
Registered User
 
Join Date: Sep 2003
Posts: 13
If you have a text file with the dump for ALL of the databases i do not believe there is a way to tell mysql not to import specific tables (that is, without restructuring the create/insert statements).

I would just separate the file into smaller files (assuming you're on linux/bsd/etc).

grep for the start of the create database statement for the one you want, then grep for the start of the next one, take those two line numbers and use head/tail (or something similar) to separate them out and put them into a new file, then import it.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On