是的,另一个 MySql: ERROR 1045/ 28000/: 禁止访问用户 'root'@'localhost' /使用密码:是的/

所以我不确定是什么让它扰乱了我的密码 MySql /更新 Mountain Lion, 重新安装 ruby/rails /其他问题/ 或者运气不好/, 但在这里我们在这里:

对mysql的入口是正常的,但我无法进入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:


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 一天,它杀了我。

有没有钩子?
已邀请:

涵秋

赞同来自:

你可以
http://dev.mysql.com/doc/refma ... .html
/服务器,不是命令行监视器/ 从
--skip-grant-tables

, 暂时禁用权限系统。 这将允许您登录,更新您的帐户/没有这些被宠坏的许可证的密码。 一切都是固定的,你会这样做
flush privileges;

, 再次打开权限系统。

三叔

赞同来自:

好吧,我用教科书了解它
http://www.thegeekstuff.com/20 ... dows/
:

我不知道如何运行授权传递表,如下所示:


Last login: Wed Aug 22 23:10:42 on console
Ayman$ --skip-grant-tables
-bash: --skip-grant-tables: command not found
Ayman$ mysql
ERROR 2002 /HY000/: Can't connect to local MySQL server through socket '/tmp/mysql.sock' /2/
Ayman$ --skip-grant-tables
-bash: --skip-grant-tables: command not found


这就是我谷授予授权传递表的地方,并找到了上面指定的教科书:

我不认为教科书的任何进入部分工作:


Ayman$ # vi /etc/rc.d/init.d/mysql
Ayman$ $bindir/mysqld_safe --datadir=$datadir --pid-file=$server_pid_file $other_args >/dev/null 2>&1 &
[1] 302
Ayman$ $bindir/mysqld_safe --skip-grant-tables --datadir=$datadir --pid- file=$server_pid_file $other_args >/dev/null 2>&1 &
[2] 303
[1] Exit 127 $bindir/mysqld_safe --datadir=$datadir --pid- file=$server_pid_file $other_args > /dev/null 2>&1
Ayman$ mysql start
ERROR 2002 /HY000/: Can't connect to local MySQL server through socket '/tmp/mysql.sock' /2/
[2]+ Exit 127 $bindir/mysqld_safe --skip-grant-tables --datadir=$datadir - -pid-file=$server_pid_file $other_args > /dev/null 2>&1
Ayman$ # service mysql start
Ayman$ mysql -u root mysql
ERROR 2002 /HY000/: Can't connect to local MySQL server through socket '/tmp/mysql.sock' /2/
Ayman$ mysql


ERROR 2002 /HY000/: 无法连接到本地服务器 MySQL 通过套接字 '/tmp/mysql.sock' /2/

这是,魔术!:


Ayman$ mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.5.27 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.

mysql> UPDATE user SET password=PASSWORD/'newpassword'/ WHERE user='root';
Query OK, 4 rows affected /0.11 sec/
Rows matched: 4 Changed: 4 Warnings: 0

mysql> flush privileges
-> ;
Query OK, 0 rows affected /0.00 sec/


甚至更多的东西从上面的链接不起作用:


mysql> service mysql stop
-> ;
ERROR 1064 /42000/: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'service mysql stop' at line 1
mysql> # service mysql stop
mysql> # vi /etc/rc.d/init.d/mysql
mysql> $bindir/mysqld_safe --datadir=$datadir --pid-file=$server_pid_file $other_args >/dev/null 2>&1 &
->
-> ;
ERROR 2006 /HY000/: MySQL server has gone away
No connection. Trying to reconnect...
ERROR 2002 /HY000/: Can't connect to local MySQL server through socket '/tmp/mysql.sock' /2/
ERROR:
Can't connect to the server

mysql> $bindir/mysqld_safe --skip-grant-tables --datadir=$datadir --pid- file=$server_pid_file $other_args >/dev/null 2>&1 &;
No connection. Trying to reconnect...
ERROR 2002 /HY000/: Can't connect to local MySQL server through socket '/tmp/mysql.sock' /2/
ERROR:
Can't connect to the server

mysql> $bindir/mysqld_safe --skip-grant-tables --datadir=$datadir --pid- file=$server_pid_file $other_args >/dev/null 2>&1 &;
No connection. Trying to reconnect...
ERROR 1045 /28000/: Access denied for user 'root'@'localhost' /using password: NO/
ERROR:
Can't connect to the server

mysql> $bindir/mysqld_safe --datadir=$datadir --pid-file=$server_pid_file $other_args >/dev/null 2>&1 &;
No connection. Trying to reconnect...
ERROR 1045 /28000/: Access denied for user 'root'@'localhost' /using password: NO/
ERROR:
Can't connect to the server


IT - H。 ALIVE!!!!:


mysql> quit
Bye
Ayman$ mysql -u root -p
Enter password: newpassword
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 25
Server version: 5.5.27 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.


谢谢BIA和社区 StackOverflow 因为我指定了正确的方向并将这个新手归还给游戏!!

要回复问题请先登录注册