MySQL-csv insert into tables doesn't take effect

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

 



Hi.. I create a data.csv file using excel file and
convert to CSV as following

[root@box root]# more data.csv
departmentID,name,job
1,IT,IT-infra
2,HR,Human Resource
3,Finance,Financing

>>then I create a table 'department' with the
following

use testdb;
create table department
(
    departmentID int not null auto_increment primary
key,
    name varchar(30),
     job varchar(30)
     )
    type=InnoDB;

#####################################################
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;

mysql> select * from department;
+--------------+------+------+
| departmentID | name | job  |
+--------------+------+------+
|            1 | NULL | NULL |
|            2 | NULL | NULL |
|            3 | NULL | NULL |
+--------------+------+------+
3 rows in set (0.00 sec)



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 


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

  Powered by Linux