XAMPPでのphpMyAdmin#1045エラー
かなり初歩的なエラーですが参考になればと思いエントリーします。
データベースの確認をしようとXAMPPの管理画面からphpMyAdminをクリックしたらこんな画面が。。。
MySQL サーバに接続しようとしましたが拒否されました。config.inc.php のホスト、ユーザ名、パスワードが MySQL サーバの管理者から与えられた情報と一致するか確認してください
エラー
MySQLのメッセージ:#1045 - Access denied for user 'pma'@'localhost' (using password: NO)
phpMyAdminに入れない。。。
5分ほどあわててふと冷静に考えたら前回のアクセス時にパスワード設定してただけでした。
そういやPEAR::DBの設定のためにコマンドプロンプトでユーザー名とパスワードいじったんだったけ。
とりあえずxampp¥phpMyAdmin¥config.inc.phpを開いてみる。
PHP:
-
$cfg['Servers'][$i]['controluser'] = 'pma'; // MySQL control user settings
-
// (this user must have read-only
-
$cfg['Servers'][$i]['controlpass'] = ' '; // access to the "mysql/user"
-
// and "mysql/db" tables).
-
// The controluser is also
-
// used for all relational
-
// features (pmadb)
-
$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
-
$cfg['Servers'][$i]['user'] = '●●●●'; // MySQL user
-
$cfg['Servers'][$i]['password'] = '****'; // MySQL password (only needed
-
// with 'config' auth_type)
あれ?ちゃんとユーザー名もパスワードも正しいじゃん???
???とよーくコード見ると61~63行目とエラー表示の 'pma'@'localhostが気になる。
「あっ」と思いなおし61~63行目を修正。
PHP:
-
$cfg['Servers'][$i]['controluser'] = '●●●●'; // MySQL control user settings
-
// (this user must have read-only
-
$cfg['Servers'][$i]['controlpass'] = '****'; // access to the "mysql/user"
-
// and "mysql/db" tables).
-
// The controluser is also
-
// used for all relational
-
// features (pmadb)
-
$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
-
$cfg['Servers'][$i]['user'] = '●●●●●'; // MySQL user
-
$cfg['Servers'][$i]['password'] = '****'; // MySQL password (only needed
-
// with 'config' auth_type)
これで再度phpMyAdminにアクセス。
今度はOK。無事phpMyAdmin画面が表示されました。
コマンドプロンプトで設定を変えてしまったらconfig.inc.phpも変えなければいけない。という単純なミスでした。
またやらかしそうなのでメモしときます。
カテゴリー: XAMPP
2007年の更新でしたが、悩んでいた部分の解決に繋がる記事で
大変ありがたく熟読させていただきました。
ありがとうございました!