今天写项目时遇到这个问题: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 'root '@‘localhost’ (using password: NO))
发现是没修改密码,所以连接不上MySQL数据库。如图所示:
找到db.properties文件,将密码改为自己的MySQL数据库连接密码。
datasource.connection.driver_class=com.mysql.jdbc.Driver
datasource.connection.url=jdbc:mysql://localhost:3306/db?useUnicode=true&characterEncoding=utf-8
datasource.connection.username=root
datasource.connection.password=123456
我设的密码为:123456
修改后数据库连接成功!
相关文章
- 解决Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException
- Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connectio
- redis使用问题一:Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisException: Could not get a resource from the pool] with root cause
- Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransien
- 【错误】:Could not open JDBC Connection for transaction; nested exception is: Communications link failure;The last packet sent successfully to the server was 1 milliseconds ago
- Could not open JDBC Connection for transaction; nested exception is com.alibaba.druid.pool.GetConnec
- jdbc连接oracle时报错 Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableC
- Could not open JDBC Connection for transaction; nested exception is com.alibaba.druid.pool.GetConnection
- Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransien