Access denied for user 'root'@'127.0.0.1' (using password: YES)
来源:互联网 发布:淘宝美工私活 编辑:程序博客网 时间:2024/06/06 02:42
在java项目中使用连接串设为 localhost 时报以下错误,但在服务器中使用mysql -u root却可以登录
2014-08-29 09:05:29,181 WARN com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1841) - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@67618412 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (10). Last acquisition attempt exception:
java.sql.SQLException: Access denied for user 'root'@'127.0.0.1' (using password: YES)at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1086)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:928)
原因:
mysql.user中有多条root用户的权限记录,其中有些绑定了ip或域名(host字段)。
解决方法:
user中有多条root记录时,mysql会优先判断是否使用了绑定的ip,所以将localhost设置成对应的Ip 就可以,也可以把user表中绑定固定Ip的记录删除,只保留host字段为localhost或%的记录
- Access denied for user 'root'@'127.0.0.1' (using password: YES)
- Access denied for user 'root'@'127.0.0.1' (using password: YES)
- Access denied for user ‘root’@’127.0.0.1’(using password:YES)
- 连接mysql的时候报错Access denied for user: 'root@127.0.0.1' (Using password: YES)
- ERROR 1045 (28000): Access denied for user 'root'@'127.0.0.1' (using password: YES)
- 【MySQL】Access denied for user 'root'@'127.0.0.1' (using password: YES)解决方法
- #1045 - Access denied for user 'root'@'localhost' (using password: YES)
- Access denied for user 'root'@'localhost' (using password: YES) 问题解决
- 解决'Access denied for user 'root'@'localhost' (using password: YES)'
- access denied for user 'root'@'localhost' using password yes
- access denied for user 'root'@'localhost' using password yes
- 1045 access denied for user 'root'@'localhost' using password yes
- Access denied for user 'root'@'localhost' (using password: YES)解决办法
- Access denied for user: 'root@localhost' (Using password: YES)
- Access denied for user 'root'@'localhost' (using password: YES)
- Access denied for user 'root'@'localhost' (using password:YES) 解决方案
- mysql Access denied for user 'root'@'localhost' (using password: YES)
- Access denied for user 'root'@'localhost' (using password: YES)
- Mysql数据类型
- .NET vs installer安装项目失败汇总
- Unity3d 动画会出现的小问题
- HTTP-安全
- Pascal's Triangle Java
- Access denied for user 'root'@'127.0.0.1' (using password: YES)
- javascript 查看 json 字符串内容
- POJ-1986-Distance Queries
- JAVA开发者最常去的20个英文网站
- Ubuntu14.04下源码编译安装Subversion1.8.10
- SQL Server 2008 还原数据库
- 智能交通焕发勃勃生机,未来会呈现哪些巨变?
- c++ foreach的使用
- 深入理解Linux内存管理机制