请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

进行http://localhost:8088/user/forget_check_answer.do测试时,报错?

报500 Internal Server Error

错控制台报错

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: FUNCTION mmall_learning.COUNT does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual

### The error may exist in file [E:\tts9\JAVA_TOOLS\tts9\apache-tomcat-7.0.67\webapps\ROOT\WEB-INF\classes\mappers\UserMapper.xml]

### The error may involve com.mmall.dao.UserMapper.checkAnswer-Inline

### The error occurred while setting parameters

### SQL: SELECT     COUNT (1)     from mmall_user     WHERE username = ?     and question = ?     and answer = ?

### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: FUNCTION mmall_learning.COUNT does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual

; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: FUNCTION mmall_learning.COUNT does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual] with root cause

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: FUNCTION mmall_learning.COUNT does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)


正在回答 回答被采纳积分+3

3回答

提问者 Diviner0359 2018-01-16 18:39:22

自己已经查证解决,我的代码sql语句写的有问题!

1 回复 有任何疑惑可以回复我~

我也遇到了欸。但是我的sql没问题啊,

控制台的输出是

[19:45:59.717][DEBUG][org.mybatis.spring.SqlSessionUtils][http-nio-8088-exec-1] Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7e755e5]
[19:46:25.235][DEBUG][org.mybatis.spring.SqlSessionUtils][http-nio-8088-exec-3] Creating a new SqlSession
[19:46:25.236][DEBUG][org.mybatis.spring.SqlSessionUtils][http-nio-8088-exec-3] SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@30f5b369] was not registered for synchronization because synchronization is not active
[19:46:25.237][DEBUG][o.m.s.t.SpringManagedTransaction][http-nio-8088-exec-3] JDBC Connection [jdbc:mysql://localhost:3306/mmall_learning?characterEncoding=utf-8, UserName=root@localhost, MySQL-AB JDBC Driver] will not be managed by Spring
[19:46:25.237][DEBUG][com.mmall.dao.UserMapper.checkAnswer][http-nio-8088-exec-3] ==>  Preparing: SELECT COUNT (1) FROM mmall_user WHERE username=? AND question=? AND answer=? 
[19:46:25.238][DEBUG][com.mmall.dao.UserMapper.checkAnswer][http-nio-8088-exec-3] ==> Parameters: admin(String), 问题(String), 123(String)
[19:46:25.239][DEBUG][org.mybatis.spring.SqlSessionUtils][http-nio-8088-exec-3] Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@30f5b369]

页面上是https://img1.sycdn.imooc.com//szimg/5a75a2540001614607270713.jpg

0 回复 有任何疑惑可以回复我~
  • 错误码: 1630
    FUNCTION count does not exist. Check the'Function Name Parsing and Resolution' section in the Reference Manual
    解决方案:如sum() count() avg这些函数里面是这样子写的sum () sum和()分开了,不是挨着写的,所以报这个错
    回复 有任何疑惑可以回复我~ 2018-02-03 21:02:25
  • 你好,我碰到同样的问题,但是我是分开写的,结果报这个错误,然后我不分开写就成功了,这个是ide的关系还是啥问题?
    回复 有任何疑惑可以回复我~ 2019-07-24 17:55:24
Geely 2018-01-20 15:46:25

赞,解决了就好,够细心!



【这个帖子好好看看哟,给同学们整理的学习课程的集锦宝典】
课程项目思维导图及线上环境、测试环境、部署linux和windows等解答
http://www.imooc.com/article/20193 

部署环境的话 ,建议看下文章最后一小段哟~首先跟着课程阿里云部署那个章节过一遍,可以先不跟着操作,做到心里有数,环境部署都做了什么。

尽快进入咱们QQ群哟~~进群方法下面思维导图那个帖子有。非常详细

课程项目思维导图及线上环境、测试环境、部署linux和windows等解答
http://www.imooc.com/article/20193 

【重点】问答区常见问题整理
http://www.imooc.com/article/18998

课程项目QQ群分享手记
http://www.imooc.com/article/19094


找工作的季节之简历及找工作的分享
http://www.imooc.com/article/19998

项目环境、vsftpd、linux、mysql等各种配置、软件下载
http://learning.happymmall.com


mybatis-plugin插件安装
http://coding.imooc.com/learn/questiondetail/36007.html

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号