0
0

More than 1 year has passed since last update.

MySQLにアクセスする時に発生する例外の対処法

Last updated at Posted at 2021-03-08

MySQLにアクセスしようとしたら拒否されて例外が発生してアクセスできなかったので、色々と調べました。

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

どうやらrootユーザが設定されていなくてこのようなエラーが発生することがあるようです。

このエラーが出た時はまずMySQLを停止してから、オプション付きで起動することによって解決しました。

1、まずは一旦停止します。

# service mysqld stop

2、次にMySQLを–skip-grant-tablesオプション付きで起動します。
これはMySQLの権限システムを使用しないで起動するためのものだそう。

# mysqld_safe --skip-grant-tables &

僕の場合はこれで解決しました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0