load data infile语句问题
导入数据语句如下:
load data infile 'd:/userDesc.txt' into table test.user(uname,num,deptNum) terminated by ',' enclosed by '\'' lines terminated by '\r\n';
报错如下:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'termi
nated by ',' enclosed by '\'' lines terminated by '\r\n'' at line 1
load data infile 'd:/userDesc.txt' into table test.user(uname,num,deptNum) terminated by ',' enclosed by '"' lines terminated by '\r\n';
报错同上,大虾赐教
[解决办法]
load data infile 'd:/userDesc.txt' into table test.user FIELDS terminated by ',' enclosed by '\'' lines terminated by '\r\n' (uname,num,deptNum);