LoginSignup
1
0

More than 5 years have passed since last update.

[CPI]MySQL5.6でのWP-CLIはポート番号指定が必要

Last updated at Posted at 2017-08-22

CPIサーバー(SmartRelease)にSSH接続してWP-CLIのコマンドを使ってみると以下のような現象に。

> wp site list

Error: データベース接続確立エラー. これは、`wp-config.php` ファイルのユーザー名とパスワードが正しくないか、あるいは `127.0.0.1` のデータベースサーバーに接続できないかのどちらかを意味します。ホスティングサービスのデータベースサーバーがダウンしているかもしれません。

インストールされたMySQLは5.6で、ポート番号がデフォルトの3306ではなく、3307になっており、正しく設定できていないことが原因だった。

wp-config.php
define('DB_HOST', '127.0.0.1:3307');

MAMPの時はソケットの位置指定が必要だったが、今回はポート番号。

1
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
1
0