错误:
There was an unexpected error (type=Internal Server Error, status=500).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 '12357144143'@'117.159.39.79' (using password: YES) ### The error may exist in file [D:\IDEA_Program\IDEA??\SpringBootTest\Deom1-SpringBoot\target\classes\ALLpa\mapper\userMapper.xml] ### The error may involve ALLpa.mapper.userMapper.findAllUser ### 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 '12357144143'@'117.159.39.79' (using password: YES)
原因(在用数据库连接工具可以连接的情况下):
1、如果SpringBoot的版本较低,并且,数据库的密码时纯数字时
------- 密码需要加 双引号 或 单引号

2、如果用户名有下划线,由于SpringBoot会自动将下划线映射为驼峰式因此
------- 用户名需要加上单引号



392

被折叠的 条评论
为什么被折叠?



