解决:[Err] 1064 - 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
在mysql执行插入数据的操作时报错:[Err] 1064 - 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 'key,enkey,content) values('1','1','1','1','1','1','石家庄')' at line 1
我的sql语句为:insert into doclist(title,entitle,zhaiyao,enzhaiyao,key,enkey,content) values('1','1','1','1','1','1','石家庄'),看上去sql语句并没有错,可运行起来就是不成功。根据报错信息我们可以了解到错误在key,enkey和content附近,
key这里标蓝,代表了关键字,普通属性与关键字冲突,网上查阅资料说加什么反引号,要我说直接把key改个名就行,快速又简单。最后将key改为keyw,运行数据插入成功。