XREA+ データベース複数化
投稿日: 2007年 2月 15日
「Xrea+では、データベースを5つまで設置できる」
バカなことに最近知ったんですよ、これ。
1. MySQLの設定

XREA管理画面 > データベース にて、「■MySQL」の「データベース名を選択 : 」の○○○_2∼○○○_5から任意に選択し、データベース接続へのパスワードを入力。パスワードは○○○のデータベースと同じでもいい。その後「作成」をクリックして、5分ほど待つと設定が反映される。
2. phpMyAdmin の設定
phpMyAdminの設定ファイルを修正して、新しく作成したデータベースを管理できるようにする。
設定ファイル「/public_html/log/phpmyadmin/config.inc.php」をFTPソフトで一度DLして、テキストエディタで修正する。
-
$cfg['Servers'][$i]['host'] = 'localhost';
-
$cfg['Servers'][$i]['user'] = '○○○_2';
-
$cfg['Servers'][$i]['password'] = 'password2';
-
$cfg['Servers'][$i]['only_db'] = '○○○_2';
※1 ”○○○”はアカウント名
※2 ○○○_2を選択した例
テストサイトの wp-config.php はこうなる。
-
define('DB_NAME',
'○○○_2');
// The name of the database
-
define('DB_USER',
'○○○_2');
// Your MySQL username
-
define('DB_PASSWORD',
'password2');
// ...and password
-
define('DB_HOST',
'localhost');
// 99% chance you won't need to change this value

修正したconfig.inc.phpをアップロードして終了。phpMyAdminにアクセスして「サーバーの選択」から指定したデータベース名があるか確認する。
これでテストサイトを作って、遊んでみましょ。ぐちゃぐちゃになっても追加したデータベースをさくっと削除すれば問題ないし。テストサイトの不具合でメインサイトが足を引っぱられる心配もなし。しかも、同じ環境でテストできるし。(うはうは)
【2009-5-18 追記】
うれPさんにわかりにくいとのご指摘をいただいましたので、s297サーバーの config.sample.inc.php を参考に書いてみます。(もちろん、config.inc.php にリネームしなければなりません)
-
<?php
-
-
/* $Id: config.sample.inc.php 9689 2006-11-10 20:05:49Z nijel $ */
-
// vim: expandtab sw=4 ts=4 sts=4:
-
-
/**
-
* phpMyAdmin sample configuration, you can use it as base for
-
* manual configuration. For easier setup you can use scripts/setup.php
-
*
-
* All directives are explained in Documentation.html and on phpMyAdmin
-
* wiki <http://wiki.cihar.com>.
-
*/
-
-
/*
-
* This is needed for cookie based authentication to encrypt password in
-
* cookie
-
*/
-
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
-
-
/*
-
* 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;
-
/* Select mysqli if your server has it */
-
$cfg['Servers'][$i]['extension'] = 'mysql';
-
/* User for advanced features */
-
$cfg['Servers'][$i]['controluser'] = 'pma';
-
$cfg['Servers'][$i]['controlpass'] = 'pmapass';
-
$cfg['Servers'][$i]['only_db'] = 'pma';
-
/* Advanced phpMyAdmin features */
-
// $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]['designer_coords'] = 'pma_designer_coords';
-
-
/*
-
* End of servers configuration
-
*/
-
-
/*
-
* Directories for saving/loading files from server
-
*/
-
$cfg['UploadDir'] = '';
-
$cfg['SaveDir'] = '';
-
-
?>
ユーザー"pma"、パスワード"pmapass" です。
で、2つ目のDBを作ります。ユーザー"pma2"、パスワード"pma2pass" でいきます。
-
<?php
-
-
/* $Id: config.sample.inc.php 9689 2006-11-10 20:05:49Z nijel $ */
-
// vim: expandtab sw=4 ts=4 sts=4:
-
-
/**
-
* phpMyAdmin sample configuration, you can use it as base for
-
* manual configuration. For easier setup you can use scripts/setup.php
-
*
-
* All directives are explained in Documentation.html and on phpMyAdmin
-
* wiki <http://wiki.cihar.com>.
-
*/
-
-
/*
-
* This is needed for cookie based authentication to encrypt password in
-
* cookie
-
*/
-
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
-
-
/*
-
* 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;
-
/* Select mysqli if your server has it */
-
$cfg['Servers'][$i]['extension'] = 'mysql';
-
/* User for advanced features */
-
$cfg['Servers'][$i]['controluser'] = 'pma';
-
$cfg['Servers'][$i]['controlpass'] = 'pmapass';
-
$cfg['Servers'][$i]['only_db'] = 'pma';
-
/* Advanced phpMyAdmin features */
-
// $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]['designer_coords'] = 'pma_designer_coords';
-
-
/*
-
* Second 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;
-
/* Select mysqli if your server has it */
-
$cfg['Servers'][$i]['extension'] = 'mysql';
-
/* User for advanced features */
-
$cfg['Servers'][$i]['controluser'] = 'pma2';
-
$cfg['Servers'][$i]['controlpass'] = 'pma2pass';
-
$cfg['Servers'][$i]['only_db'] = 'pma2';
-
/*
-
* End of servers configuration
-
*/
-
-
/*
-
* Directories for saving/loading files from server
-
*/
-
$cfg['UploadDir'] = '';
-
$cfg['SaveDir'] = '';
-
-
?>
こんな要領で、5つまで増やせます。
ありゃ?知らなかったの?
普通に使えてますよん!
これにて速くなるかは?です。
教えてよん。
速くなるのはまるで期待してませんが、別にしておいた方が削除の際に間違えなくてよいかと・・・。
はじめまして
いつもwpのカスタマイズを参考にさせてもらっています。
XREAのデータベースのphpMyAdminのバージョンによってはconfig.inc.phpを編集しなくても複数使えるのもあります。
2年前の2.6.1-pl2はXREAの鯖の管理画面から複数作成すれば自然に反映されていました。
ところが2.8.0-rc1だとconfig.inc.phpの編集が必要なんですよね。
MacIEからだとかなりレイアウトも崩れるのでCSSの編集まで必要になります。
バージョンが上がって使いづらくなりました
はじめまして、mooさん。
へぇ∼、そうなんですか。
Xrea歴1年たたないもので、まだまだ知らないことも多いっす。
phpMyAdminよりMySQLのバージョンを上げてくれないかなぁ∼。
phpMyAdminだったら、WordPressのプラグインに「WP-phpMyAdmin Plugin」がありますよ∼。
しかも、Masayan様自ら日本語化に取り組まれていますよ∼。
しかし、ヴァージョンを確認したら2.8.2だった(自爆)。
はじめまして。
お試しでCOREを使っているところですが、こちらの情報がとても役に立ちました!
とだけしか書かれてなくて困っていました。
上記の通り書き直して無事に増やすことができました。ありがとうございました
( ノ゚Д゚)こんばんわ
以前は、DBを追加で作成したら、phpadmimin でDBが選択できていたのに・・・
s366鯖に移動したら、できなくなっていました ><
コントロールパネルからはDBが見えるのに、phpadminでは見えなくて、【また】DBが壊れたのかと、XREAに問い合わせしようとしたたとこでした ^^;
config.inc.phpの書き方とか、こことか、他のサイトも見たんだけど・・・
よくわかんない ><
$i=0;
$1++;
とかって・・・?
どこからどこまでが、一つで、新しいDBの記述はどこに書けばいいのか ^^;
(´ヘ`;) う∼ん・・・
_| ̄|○ il||li
おはよう。
上の記事に追記してみました。どうもコメントじゃ説明できない。orz
こんばんわ。
参考になります。が、どうも上手くいきません。
私はs335サーバーでmyphpadminで2個目のデータベースが見れません。
なんとかエクスポートしないと引越しが出来ない・・・
config.ing.phpを書き換える際行ったことは、
* Second server以下をコピペして付け足し、です。
>修正したconfig.inc.phpをアップロードして終了。phpMyAdminにアクセスして
>「サーバーの選択」から指定したデータベース名があるか確認する。
なんとかここまでは出来ました。が、ログインできません。
あらゆるユーザー名とPassを入れたのですが。
なにが足りないのでしょうか?
はじめまして、hkさん。
もう作ってるのに見えないってことですか?
あらゆるも何もPHPMyAdminにログインできれば見れるはずですが・・・・。
もう少しわかりやすいように画像を追加しました。どうでしょう?
Masayan さん
早速のアドバイスありがとうございます。
UPして頂いた画像の所までは出来まして、localhostpma2がプルダウンメニューから見えるのですが、選択するとログイン画面に戻ってしまい、
ログインを試みても
エラー
#1045 – Access denied for user ‘pma2′@’localhost’ (using password: YES)
というのが出てしまいログイン出来ないです。
DB/ユーザー名やパスワードは登録してある全てのMySQLのデータベースの物を入れてみたのですが、どうしてもログインが出来ない状態です。
ここは何を入れれば良いのでしょうか?
そういうことなんですね。
なんかググるとかなりヒットしますねぇ・・・。
>Google 検索
いろいろあるんですねー。知りませんでした。イマイチな回答でスイマセン。