是的,另一个MySql:错误1045(28000):用户'root'@'localhost'的访问被拒绝(使用密码:是) [英] Yes, Another MySql: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

查看:86
本文介绍了是的,另一个MySql:错误1045(28000):用户'root'@'localhost'的访问被拒绝(使用密码:是)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我不确定是什么原因导致了该密码扰乱我的MySql密码(升级到Mountain Lion,重新安装ruby/rails(其他问题),或者只是运气不佳),但是我们在这里:

So I'm not sure what caused this to scramble my MySql password (upgrade to Mountain Lion, reinstalling ruby/rails (other issues), or simply just bad luck) but here we are:

登录mysql很好,但是我无法登录到根

Logging in to mysql is fine, but I can't log into the root

Ayman$ mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 96
Server version: 5.5.25 MySQL Community Server (GPL)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

当我尝试登录到root时:

When I try to login to root:

Ayman$ mysql -u root -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

查看用户:

mysql> CREATE USER root@localhost IDENTIFIED BY 'out22out';
ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER privilege(s)     for this operation
mysql> SELECT USER(),CURRENT_USER();
+-----------------+----------------+
| USER()          | CURRENT_USER() |
+-----------------+----------------+
| Ayman@localhost | @localhost     |
+-----------------+----------------+
1 row in set (0.00 sec)

mysql> SELECT USER, HOST FROM mysql.user;
ERROR 1142 (42000): SELECT command denied to user ''@'localhost' for table 'user'
mysql> select user, host from mysql.user;
ERROR 1142 (42000): SELECT command denied to user ''@'localhost' for table 'user'
mysql> grant all on *.* to Ayman@'%';
ERROR 1045 (28000): Access denied for user ''@'localhost' (using password: NO)
mysql> 

我尝试过重新安装MySql(不确定如何卸载),停止服务器实例并重新启动它,以及其他所有建议,如右图所示.我已经花了3天了,这真让我丧命.

I've tried reinstalling MySql (not sure how to uninstall it), stopping the server instance and restarting it, and every other suggestion on the myriad of similar questions to the right. I've been on this for 3 days now and it's killing me.

有任何线索吗?

推荐答案

您可以开始带有--skip-grant-tables的MySQL (服务器,而不是命令行监视器),它会暂时关闭权限系统.这样一来,您就可以进入,更新帐户/密码,而不会干扰那些繁琐的权限.解决问题后,您可以执行flush privileges;重新启用权限系统.

You can start MySQL (the server, not the command line monitor) with --skip-grant-tables, which shuts off the permissions systems temporarily. That'll let you get in, update your accounts/passwords without those screwed up permissions getting in the way. Once things are fixed, you do a flush privileges; to re-enable the permissions system.

这篇关于是的,另一个MySql:错误1045(28000):用户'root'@'localhost'的访问被拒绝(使用密码:是)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆