首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

load data infile语句有关问题

2012-04-18 
load data infile语句问题导入数据语句如下:load data infile d:/userDesc.txt into table test.user(un

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

热点排行