|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
I have a 250mb dump and need to extract some data. I know how to export a single table, but not import a single table using mysqldump. Any ideas? Thanks |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Hello,
If it is a dump you can pipe it into mysql. If you have a csv like file you can import it with LOAD DATA LOCAL INFILE like things. An example below: DROP TABLE IF EXISTS EnsgDescriptions; CREATE TABLE IF NOT EXISTS EnsgDescriptions (stable_id VARCHAR(128) PRIMARY KEY, description VARCHAR(128)); LOAD DATA LOCAL INFILE 'imports/ensgdescriptions.csv' INTO TABLE EnsgDescriptions; Wkr (don't write this in your script :-), -- Dr. Werner Van Belle http://werner.sigtrans.org/ |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
A little bit easier of a way to do this could be the following command:
mysql -u[user] -h[host] -p [database] < [mysql dump file] Make sure the database you're importing into is EMPTY (or at least the TABLES you are importing to are empty...) On 10/19/07, Werner Van Belle <werner@sigtrans.org> wrote: > > Hello, > > If it is a dump you can pipe it into mysql. If you have a csv like file > you > can import it with LOAD DATA LOCAL INFILE like things. An example below: > > DROP TABLE IF EXISTS EnsgDescriptions; > CREATE TABLE IF NOT EXISTS EnsgDescriptions > (stable_id VARCHAR(128) PRIMARY KEY, > description VARCHAR(128)); > LOAD DATA LOCAL INFILE 'imports/ensgdescriptions.csv' > INTO TABLE EnsgDescriptions; > Wkr (don't write this in your script :-), > > -- > Dr. Werner Van Belle > http://werner.sigtrans.org/ > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/mysql?unsub=c...tler@gmail.com > > |
|
![]() |
| Outils de la discussion | |
|
|