SSM下数据库连接失败怎怎么回事?有没有大佬看下问题
SSM连接mysql问题
- 我写的方法名对应是没有问题的
- Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
- The error may exist in file [D:\java\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\StudentManager\WEB-INF\classes\config\mybatis\mapper\UserMapper.xml]
- The error may involve com.ischoolbar.programmer.dao.UserDao.findByUserName
- The error occurred while executing a query
- Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.] with root cause
我写的方法名对应是没有问题的
6月 09, 2020 4:39:42 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [DispatcherServlet] in context with path [/StudentManager] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
The error may exist in file [D:\java.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\StudentManager\WEB-INF\classes\config\mybatis\mapper\UserMapper.xml]
The error may involve com.ischoolbar.programmer.dao.UserDao.findByUserName
The error occurred while executing a query
Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.] with root cause
以下使我的配置
!](https://img-blog.****img.cn/20200609164846696.png)