エラー1044(42000):データベース 'mysql'へのユーザー '' @ 'localhost'のアクセスが拒否されました



Error 1044 Access Denied



2日前にmysqlは無料インストールをインストールしましたが、アカウントとパスワードを設定しませんでした。今日、新しいデータベース、インターネット検索が少し行われると、パスワードがリセットされないため、合計が失敗します。次にパスワードを入力し、「mysql」データベースを使用するようにパスワードを設定しますが、文句を言います。エラー1044(42000):データベース 'mysql'へのユーザー '' @ 'localhost'のアクセスが拒否されました

後で解決策が見つかり、my.iniはskip-grant-tablesを追加しました。



[mysqld] skip-grant-tables
#先頭の#を削除し、最も重要なデータのRAMの量に設定します
Welcome to the MySQL monitor. Commands end with or g. Your MySQL connection id is 1 Server version: 5.6.25 MySQL Community Server (GPL) Copyright (c) 2000, 2015, 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を再起動し、サービスを再起動します。

次に、mysqlを開きます

mysql> use mysql Database changed mysql>
mysql> update user set password=password('12345') where user='root' Query OK, 3 rows affected (0.05 sec) Rows matched: 3 Changed: 3 Warnings: 0この場合、mysqlupを使用できます。
|_+_|
次にパスワードを変更します
 my.iniの変更を一晩終了します。