错误:You have an error in your SQL syntax。

错误的详细情况如下:Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'from msg_message t' at line 6.快来一起解决这个问题吧!

材料/工具

电脑

方法

首先要了解这个错误,这个错误是本质是mysql数据库报的错,所以java也好,php也好报错都是mysql反溃给控制台的。错误就发生在java控制台具体如图:

错误:You have an error in your SQL syntax。

找到错误的主体部分进行简单的翻译一下,英语渣的同学建议使用翻译软件具体如图:这里的错误主题应该是: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 'from msg_message t' at line 6

错误:You have an error in your SQL syntax。

根据上面的翻译我们大概得到结论:在sql语句的第6行有个语法错误。去检查一下。由于sql语句写在了mybaitis中所以要去xml配置文件中寻找,具体情况如图:

错误:You have an error in your SQL syntax。

看了半天原来是多了一个逗呢所按号,好了去掉它。重启tomcat服务器。

错误:You have an error in your SQL syntax。

错误:You have an error in your SQL syntax。

tomcat重新启动成功,访问刚才报错的页面,恢复正常。

错误:You have an error in your SQL syntax。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 951076433@qq.com 举报,一经查实,本站将立刻删除。如若转载,请注明出处:https://www.xiaomafuwu.com/207573.html

(0)
代码小二的头像代码小二

相关推荐