check the manual that corresponds to your MySQL server version for the right syntax to use near ‘XX‘

问题描述:

我的项目原来是使用Orcale的,为了方便使用我想把它改为mysql的。在完成重新建表进行测试时,出现这个令人匪夷所思的bug——check the manual that corresponds to your MySQL server version for the right syntax to use near ‘where id=‘1’’,还说是语法错误。

原因分析:

在查看出错的sql语句后,我很确信语法不会有问题。这能怎么错???
在这里插入图片描述
参考了这篇博文,我觉得问题应该在关键字上。

解决方案:

首先找到member表,看了一下表的列名,没有问题。又因为报错中指出,问题在where id='1’附近,所以只能是member作为表名有问题。因此,修改了member表为members。问题解决。

ps:我用的mysql是8.0.18,百度搜索mysql关键字时没找到member,可能是因为网上资料版本较老。

另附:
MySQL关键字大全

猜你喜欢

转载自blog.csdn.net/qq_35531985/article/details/112790258