わかりました、このウェブサイトのチュートリアルを使用してそれを理解しました:
以下に示すように、スキップ許可テーブルを実行する方法がわかりませんでした。
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
Skip Grant Tables をグーグル検索したところ、上記のチュートリアルが見つかりました。
チュートリアルの最初の部分が機能しているとは思わないでください。
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
エラー 2002 (HY000): ソケット '/tmp/mysql.sock' を介してローカル MySQL サーバーに接続できません (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
生きてる!!!!:
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.
私を正しい方向に導き、この初心者をゲームに戻してくれた MARC B と StackOverflow コミュニティに感謝します!!