ホーム > XAMPP > XAMPPでのphpMyAdmin#1045エラー

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:
  1. $cfg['Servers'][$i]['controluser']   = 'pma';          // MySQL control user settings
  2. // (this user must have read-only
  3. $cfg['Servers'][$i]['controlpass']   = '  ';          // access to the "mysql/user"
  4. // and "mysql/db" tables).
  5. // The controluser is also
  6. // used for all relational
  7. // features (pmadb)
  8. $cfg['Servers'][$i]['auth_type']     = 'config';    // Authentication method (config, http or cookie based)?
  9. $cfg['Servers'][$i]['user']          = '●●●●';      // MySQL user
  10. $cfg['Servers'][$i]['password']      = '****';          // MySQL password (only needed
  11. // with 'config' auth_type)

あれ?ちゃんとユーザー名もパスワードも正しいじゃん???

???とよーくコード見ると61~63行目とエラー表示の 'pma'@'localhostが気になる。

「あっ」と思いなおし61~63行目を修正。

PHP:
  1. $cfg['Servers'][$i]['controluser']   = '●●●●';          // MySQL control user settings
  2. // (this user must have read-only
  3. $cfg['Servers'][$i]['controlpass']   = '****';          // access to the "mysql/user"
  4. // and "mysql/db" tables).
  5. // The controluser is also
  6. // used for all relational
  7. // features (pmadb)
  8. $cfg['Servers'][$i]['auth_type']     = 'config';    // Authentication method (config, http or cookie based)?
  9. $cfg['Servers'][$i]['user']          = '●●●●●';      // MySQL user
  10. $cfg['Servers'][$i]['password']      = '****';          // MySQL password (only needed
  11. // with 'config' auth_type)

これで再度phpMyAdminにアクセス。
今度はOK。無事phpMyAdmin画面が表示されました。

コマンドプロンプトで設定を変えてしまったらconfig.inc.phpも変えなければいけない。という単純なミスでした。

またやらかしそうなのでメモしときます。

カテゴリー: XAMPP タグ:
  1. AK
    2009 年 12 月 22 日 16:29 | #1

    2007年の更新でしたが、悩んでいた部分の解決に繋がる記事で
    大変ありがたく熟読させていただきました。

    ありがとうございました!

  1. トラックバックはまだありません。