Re: MySQL-csv insert into tables doesn't take effect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



M E Fieu kirjoitti viestissään (lähetysaika keskiviikko, 16. 
maaliskuuta 2005 09:26):
> Hi.. I create a data.csv file using excel file and
> convert to CSV as following
(...)
> but when i tried to load the CSV file into the table
> department, the name and job column still shown as
> NULL?  Why??  Any soiution?
>
> mysql>load data local infile '/root/data.csv' into
> table department;

LOAD DATA expects by default that fields are separated by tabs, 
not commas. You must specify that a comma is used as a 
delimiter:

LOAD DATA LOCAL INFILE '/root/data.csv' INTO TABLE department 
FIELDS TERMINATED BY ',';

http://dev.mysql.com/doc/mysql/en/load-data.html

-- 
 Markku Kolkka
 markku.kolkka@xxxxxx


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux