List:General Discussion« Previous MessageNext Message »
From:Clodoaldo Pinto Date:January 29 2005 5:53pm
Subject:mysqlimport --replace
View as plain text  
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


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:
  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)

Regards, Clodoaldo Pinto
mysqlimport --replaceClodoaldo Pinto29 Jan
  • Re: mysqlimport --replaceClodoaldo Pinto29 Jan