2 messages in com.mysql.lists.mysqlmysqlimport --replace| From | Sent On | Attachments |
|---|---|---|
| Clodoaldo Pinto | 29 Jan 2005 09:53 | |
| Clodoaldo Pinto | 29 Jan 2005 11:54 |
| Subject: | mysqlimport --replace![]() |
|---|---|
| From: | Clodoaldo Pinto (clod...@gmail.com) |
| Date: | 01/29/2005 09:53:26 AM |
| List: | com.mysql.lists.mysql |
I need to update a table with mysqlimport.
I would like to update the table lines with the same unique key and mantain the other lines untouched.
When I use "mysqlimport --replace" the table lines with the same unique key are updated but the others are deleted.
Is it the expected behavior? How to avoid the other lines being deleted?
Using FC3. The server version is 4.0.23-standard and the mysqlimport version is Ver 3.4 Distrib 4.0.23.
The command line:
/usr/local/bin/mysqlimport --replace --local --fields-terminated-by=';' --fields-optionally-enclosed-by='"' --lines-terminated-by='\n' --fields-escaped-by='' --host=localhost --user=***** --password=***** --verbose dbname /path/to/txt/Temp.txt
import.log 2>>importErr.log
import.log:
Connecting to localhost Selecting database dbname Loading data from LOCAL file: /path/to/txt/Temp.txt into Temp dbname.Temp: Records: 2415 Deleted: 0 Skipped: 0 Warnings: 0 Disconnecting from localhost
importErr.log is empty.
Table structure: CREATE TABLE Temp ( team int(10) unsigned NOT NULL default '0', points int(11) NOT NULL default '0', wus int(11) NOT NULL default '0', day date NOT NULL default '0000-00-00', PRIMARY KEY (team, day) ) TYPE=MyISAM;
Regards, Clodoaldo Pinto




