org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
### The error may exist in file [E:\javatools\idea-workspace\ccs\target\classes\mapper\noticeMapper.xml]
### The error may involve com.igeekhome.ccs.dao.noticeMapper.save
### The error occurred while executing an update
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
- 网上方法,重装数据库
- 换jar包,这个试了没用
mysql-connector-java与Mysql对应版本:
Connector/J version Driver Type JDBC version MySQL Server version Status
5.1 4 3.0, 4.0, 4.1, 4.2 5.6*, 5.7*, 8.0* General availability
8.0 4 4.2 5.6, 5.7, 8.0 General availability. Recommended version
- MySQL Connector/J 8.0 is highly recommended for use with MySQL Server 8.0, 5.7, and 5.6. Please upgrade to MySQL Connector/J 8.0.
官方更推荐MySQL5.6以上使用connector/j 8.0
- 网上说username可能和springboot里面username重名了,导致报错账号密码不对,这个我不会改
- 最后的解决办法
密码加双引号,因为000在数据库里看做0