Cannot create PoolableConnectionFactory (Access denied for user ''@'localhost' to database 'hrdb')
程序员文章站
2024-03-14 17:01:52
...
Cannot create PoolableConnectionFactory (Access denied for user ‘’@‘localhost’ to database ‘hrdb’)
在使用dbcp连接池获取数据库连接时出现的异常解决方法
db.properties 配置
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/hrdb?useUnicode=true&characterEncoding=UTF-8
jdbc.username=root
jdbc.password=123456
检查配置没有问题
解决方法:
是当前root用户没有操作hrdb数据库的权限,赋予权限即可
- 方法一:
grant all on hrdb.* to 'root'@'localhost' identified by '123456';
- 方法二:
使用Navicat为aaa@qq.com添加hrdb权限
上一篇: JDBC 有关MySql jar包下载及配置,jdbc连接MySql数据的基本步骤
下一篇: MySQL使用root用户给某用户分配权限报错:Access denied for user 'root'@'%' to database 'xxx'
推荐阅读
-
ERROR 1044 (42000)Access denied for user @localhost to database
-
Access denied for user 'root'@'localhost' to database 'information_schema'
-
Cannot create PoolableConnectionFactory (Access denied for user ''@'localhost' to database 'hrdb')
-
mysql ERROR 1044 (42000): Access denied for user ''@'localhost' to database
-
mysql ERROR 1044 (42000): Access denied for user ''@'localhost' to database
-
MySQL: ERROR 1044 (42000) Access denied for user ''@'localhost' to database 'aliendatabase'
-
MySQL: ERROR 1044 (42000) Access denied for user ''@'localhost' to database 'aliendatabase'
-
Mysql Access denied for user ''@'localhost' to database 的一种解决方法
-
数据库访问异常Access denied for user ''@'localhost' to database 'xinjisudi'
-
提示:ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'的错误如何解决?