phpMyAdminは、PHPで実装されたMySQLを管理するためのツールです。
これを使用することで、ブラウザからDBを操作することが可能です。
各SQLの実行や、データの取得など、ほとんどの操作をすることができます。
phpMyAdminのサイトから、phpMyAdmin-4.0.4.2-all-languages.zip をダウンロードします。
ダウンロードしたファイルを展開して、ルートディレクトリにアップします。
アップしたディレクトリ名を「phpMyAdmin」に変更します。
※ディレクトリ名は他の名前でも問題ありません。推測されにくい名前の方がよいと思います。
config.sample.inc.phpのファイルをconfig.inc.phpに変更します。
そして以下の箇所を変更します。
$cfg['blowfish_secret'] = '[一意な文字列]';
$cfg['Servers'][$i]['host'] = '[ホスト名]';
例:
$cfg['blowfish_secret'] = '8woKI3gA';
$cfg['Servers'][$i]['host'] = 'localhost';
http://example.com/phpMyAdmin/ に接続して、ユーザー名・パスワードを入力してログインします。
これでログインできたら、設置は完了です。
このようにとても簡単に設置することができます。
環境保管領域を設定する場合の手順となります。
まずは、保管領域用のMySQLアカウントとDBを作成します。
今回は以下のように作成しました。
ユーザー名 : pbtimes_user
パスワード : pbtimes_pass
次に用意されているsqlを実行します。
※examples/create_tables.sql
mysql> source examples/create_tables.sql
最後に以下のようにconfig.inc.phpを設定します。
$cfg['Servers'][$i]['controlhost'] = 'localhost';
$cfg['Servers'][$i]['controluser'] = 'pbtimes_user';
$cfg['Servers'][$i]['controlpass'] = 'pbtimes_pass';
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
$cfg['Servers'][$i]['history'] = 'pma_history';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma_table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
$cfg['Servers'][$i]['recent'] = 'pma_recent';
$cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';
これで環境保管領域の設定が完了です。