いつものようにxampp作ったローカル環境でwordpressを編集しようと思い、apacheとmysqlをスタートさせ、クロームから「localhost/wordpress」にアクセスしたところエラーが出てしまいました。
エラーメッセージ
Warning: mysqli_real_connect(): (HY000/1130): Host 'localhost' is not allowed to connect to this MariaDB server in C:\xampp\htdocs\wordpress\wp-includes\wp-db.php on line 1612 Host 'localhost' is not allowed to connect to this MariaDB server
試したこと
調べてみると、localhostでアクセスするとtcpではない接続がされてしまうと聞き、「127.0.0.1/wordpress」でアクセスしてみたのですが駄目でした。
何か設定ファイルを変更する必要があるのだと思うのですが、どこを直せばよいか分かりません。
試しにwp-configのホスト名を変えても見たのですが状況は変わりませんでした。その他の設定ファイルの変更部分等を教えていただけると幸いです。
設定ファイルは以下の様になっています。
wp-config.php
define( 'DB_NAME', 'wp-01' ); /** MySQL データベースのユーザー名 */ define( 'DB_USER', 'root' ); /** MySQL データベースのパスワード */ define( 'DB_PASSWORD', '設定したパスワード' ); /** MySQL のホスト名 */ define( 'DB_HOST', 'localhost' );
config.inc.php
/* Authentication type and info */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; $cfg['Servers'][$i]['user'] = ''; $cfg['Servers'][$i]['password'] = ''; $cfg['Servers'][$i]['extension'] = 'mysqli'; $cfg['Servers'][$i]['AllowNoPassword'] = true; $cfg['Lang'] = ''; /* Bind to the localhost ipv4 address and tcp */ $cfg['Servers'][$i]['host'] = '127.0.0.1'; $cfg['Servers'][$i]['connect_type'] = 'tcp';

回答3件
あなたの回答
tips
プレビュー