SpringMVC+myBatis启动报错:Access denied for user 'stati'@'localhost' (using password: YES)

这个错误有点莫名其妙;在另一个工程中用的同样的配置不报错;但就这个新工程就有这一问题;

我这里“数据库链接-账户-密码”都没有问题的;用Navicat for Mysql工具是能链接成功的,所以排除了这几个错误原因;

虽然解决了这个问题;但问题原因不知道;

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'stati'@'localhost' (using password: YES))
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'stati'@'localhost' (using password: YES))

报错前的配置是这样写的:



之后改成如下就正常了:


就是在前面配置名前加了一个"db."将这一错误解决了;
 
 

你可能感兴趣的:(框架错误集合)