phpMyAdmin を使って MariaDB に接続できないのはなぜですか?
該当製品
- MariaDB 10
- QTS 5.0.x上のphpMyAdmin 4.9.11.0(またはそれ以前)
- QTS 5.1.x上のphpMyAdmin 5.2.1.0(またはそれ以前)
根本原因
MariaDB 10はビルトインアプリケーションではありません。そのため、MariaDB 10にアクセスするにはWindowsのsmb経由でphpMyAdminの設定ファイル(config.inc.php)を編集する必要があります。
対処
- 管理者としてQTSにログオンします。
- App Centerを開きます。
- phpMyAdminとMariaDB 10をインストールします。
- MariaDB 10を設定します。
- MariaDB 10を開きます。
- [Account and Database (アカウントとデータベース)]に移動します。
- [Root password (ルートパスワード)]の隣の[Reset (リセット)] をクリックします。注ルートパスワードのリセット後、アプリケーションは再起動します。ルートパスワードをリセットしても、データは失われません。
- phpMyAdminの設定を行います。
- SMB接続でWeb共有フォルダーに管理者として接続します。
- Web\phpMyAdmin\ に移動します。
- config.inc.phpをテキストエディタで開きます。
- [Servers configuration (サーバー設定)]セクションを探します。
/** * Servers configuration */ $i = 0; /** * First server */ $i++; /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = false;
- ファイルから[Servers configuration (サーバー設定)]スクリプトを削除します。
- 以下のスクリプトを入力してください。
/** * Servers configuration */ $i = 0; /** * First server */ $i++; /* Authentication type */ $cfg['Servers'][$i]['verbose'] = 'MariaDB 5'; $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['socket'] = '/tmp/mysql.sock'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = false; /** * Second server */ $i++; /* Authentication type */ $cfg['Servers'][$i]['verbose'] = 'MariaDB 10'; $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['socket'] = '/var/run/mariadb10.sock'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = false;
- ファイルを保存します。
- phpMyAdminアプリを閉じます。
- phpMyAdminアプリを再度開きます。
- [MariaDB 5]または[MariaDB 10]を選択します。
- ユーザー名とパスワードを入力します。
- [Go (移動)]をクリックします。
これでphpMyAdminでMariaDBに接続できるようになりました。