问题:报错连接不上数据库,但是在IDEA上检测数据库连接又是正常的
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Access denied for user '1'@'localhost' (using password: YES)
### The error may exist in file [D:\MyApp\JavaWeb\Spring-study\spring-04-mybatis\target\classes\com\mytest\mapper\userMapper.xml]
### The error may involve com.mytest.mapper.UserMapper.getList
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Access denied for user '1'@'localhost' (using password: YES)
原因分析:使用了db.properties中不规范,导致无法连接数据库,必须使用jdbc.dirver
而不能是driver
至于是为什么没找到原因。。。