- 论坛徽章:
- 0
|
本帖最后由 tahaomei 于 2014-09-26 16:11 编辑
比如我的sha.txt文件内容如下:
禾嘉股份;600093
大名城;600094
哈高科;600095
云天化;600096
开创国际;600097
广州发展;600098
林海股份;600099
同方股份;600100
明星电力;600101
莱钢股份;600102
青山纸业;600103
我在shell中敲入如下mysql命令:
- create database IF NOT EXISTS dbname;
- use dbname;
- create table IF NOT EXISTS tablename
- (
- id int not null auto_increment primary key,
- code int(6) not null,
- name varchar(40) not null
- )
- comment='股票代码及名称表'
- engine=InnoDB;
- load data local infile "/Users/macair/stock/dat/sha.txt" into table tablename(name,code) fields terminated by ';' lines terminated
- by '\r\n';
复制代码 结果执行的时候,出现如下错误,
ERROR 1064 (42000) at line 13: 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 '/Users/macair/stock/dat/sha.txt into table tablename(name,code) fields termin' at line 1
请问是什么原因呢?google了下,还是没找到答案,觉得自己的代码没错误啊。 |
|