解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
2015-01-31 13:46
1001 查看
本人在添加数据库权限的时候,不小心把localhost权限给删除了,实在是悲剧,解决方案如下
vi /etc/my.cnf
[mysqld]下添加
skip-name-resolve
skip-grant-tables
这两句的意思是登陆服务器不做校验,即不用输入密码
service mysqld restart 重启mysql
mysql -uroot 登陆
select user,host from mysql.user; where user='root'; 查看root
更改权限
UPDATE mysql.user SET host = 'localhost' WHERE User='root' and host='%';
flush privileges ;
vi /etc/my.cnf 删除上面添加的两条
service mysqld restart
mysql -uroot -pppp 成功登陆
ps:如果root密码忘记也可以用此方法解决
vi /etc/my.cnf
[mysqld]下添加
skip-name-resolve
skip-grant-tables
这两句的意思是登陆服务器不做校验,即不用输入密码
service mysqld restart 重启mysql
mysql -uroot 登陆
select user,host from mysql.user; where user='root'; 查看root
更改权限
UPDATE mysql.user SET host = 'localhost' WHERE User='root' and host='%';
flush privileges ;
vi /etc/my.cnf 删除上面添加的两条
service mysqld restart
mysql -uroot -pppp 成功登陆
ps:如果root密码忘记也可以用此方法解决
相关文章推荐
- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)问题的解决办法
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- Linux 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题。
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- MySql 出现ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES).问题解决方案
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO))
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:
- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)解决办法
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:
- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)解决方法
- mysql 错误解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
- ERROR 1045 (28000): Access denied for user'root'@'localhost'(using password:YES)最近解决方法在!
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: