2017-12-20 14 views
0

新しいMySQL 5.7のインストール後、私はroot pwに問題があります。MySQL 5.7.20はrootパスワードを設定できません

私はmysqld_safe --skip-grant-tables &でスタートMySQLをしようとmysql -u root

をMySQLと

[email protected] [(none)]> flush privileges; 
Query OK, 0 rows affected (0.00 sec) 

[email protected] [(none)]> ALTER USER '[email protected]' IDENTIFIED BY 'password'; 

とIMこのエラーを取得してパスワードを設定しようとするで行きますよ。

ERROR 1396 (HY000): Operation ALTER USER failed for '[email protected]'@'%' 

私もこの方法を試しました。

[email protected] [mysql]> update user set authentication_string=password('password') where user='root'; 
Query OK, 0 rows affected, 1 (0.00 sec) 
Rows matched: 0 Changed: 0 Warnings: 1 

両方(ユーザーおよびホストは '' で分割する必要がある)、これを試してみてください。..

答えて

1

を助けてください動作しない:あなたはDMLとprivelagesを変更した場合

ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; 

update user set authentication_string=password('password') where user='root'; 

あなたが実行する必要があります。

FLUSH PRIVILEGES; 
+0

これは機能しません。 – L4W

+0

あなたのために何がうまくいかなかったかは不明です。 [再設定の権限](https://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html)の手順を適用しようとしましたか? – user4936563

関連する問題