ERROR 1064 (42000): You have an error in your SQL syntax
2017-07-05 21:37
447 查看
mysql使用load data infile导入数据。出现如下错误:
root@NoName 21:19:12> load data infile /change.csv' into table change CHARACTER SET utf8 fields terminated by ',' optionally enclosed by '"' escaped by '"' lines terminated by '\n'
-> (src_company_id,company_name,change_id,no,change_date,change_name,before,after,src_created_date,
src_updated_date);
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 'before,after,src_created_date,src_updated_date)' at line 2
root@NoName 21:19:23>
原因在于,表字段使用了mysql保留字。mysql保留字晚上很多,这里就不列举了。before、after就是其中之一。
解决方法,在字段名上用尖引号括起来。如下:
`before`,`after`
root@NoName 21:19:12> load data infile /change.csv' into table change CHARACTER SET utf8 fields terminated by ',' optionally enclosed by '"' escaped by '"' lines terminated by '\n'
-> (src_company_id,company_name,change_id,no,change_date,change_name,before,after,src_created_date,
src_updated_date);
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 'before,after,src_created_date,src_updated_date)' at line 2
root@NoName 21:19:23>
原因在于,表字段使用了mysql保留字。mysql保留字晚上很多,这里就不列举了。before、after就是其中之一。
解决方法,在字段名上用尖引号括起来。如下:
`before`,`after`
相关文章推荐
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- MySql建表时出错ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that correspond
- SQL Error: 1064, SQLState: 42000 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual...
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- ERROR 1064 (42000): You have an error in your SQL syntax
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- SQL Error: 1064, SQLState: 42000 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ve
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- Error 1064(42000):you have an error in your sql syntax;一个简单的原因
- ERROR 1064 (42000): You have an error in your SQL syntax;
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- 创建存储过程错误(已解决):Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ver
- [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s
- phpmyadmin建表出错 #1064 - You have an error in your SQL syntax;