Having difficult time installing multi-db

This is about the third time I've tried to set-up multi-db over the past 6 or 8 months and have yet to succeed. Here are the details of my latest attempt:

1. I'm using the latest version of Mu
2. I've installed Mu normally and then tried to set-up multi-db with no luck. I kept getting "can't find site" errors. I moved the mu global/master (whatever they're called) tables into the global db and moved blog 1 tables into the vip db, then it tries to connect, but I get the following error:

Warning: Invalid argument supplied for foreach() in /home/XXXXX/public_html/wp-content/db.php on line 714.

3. I decided to try an install a fresh Mu with db-config.php and db.php already in place, but wasn't sure what database to enter on the install screen...I set it to the global db but got the following error:

Fatal error: Cannot redeclare class wpdb in /home/XXXXXXX/public_html/wp-content/db.php on line 76

4. So, I went back and changed it to the vip database and got the following error:

Warning: Invalid argument supplied for foreach() in /home/XXXXX/public_html/wp-content/db.php on line 714

Warning: Invalid argument supplied for foreach() in /home/XXXXX/public_html/wp-content/db.php on line 714

Warning: Invalid argument supplied for foreach() in /home/XXXXX/public_html/wp-content/db.php on line 714

Warning: Invalid argument supplied for foreach() in /home/XXXXXX/public_html/wp-content/db.php on line 714
No WPMU site defined on this host. If you are the owner of this site, please check Debugging WPMU for further assistance.

Below are the relevant parts of my db-config file...I'm using 16 db's and I've commented out add_global_table. I'm sure my db name, db user, and password are correct. I have my own dedicated server and am only using that one server. For the host and lan host, I've tried 'localhost' (which is what I use for a normal mu install), the ip for localhost that you see below, and my actual server ip.

Any help would be appreciated.

// Usage: add_dc_ip(IP, DC)
// EX: add_dc_ip('123.123.123.', 'dc1');
add_dc_ip('127.0.0.1', 'dc1');
add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_global', 'db_user', 'db_password');

add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_1', 'db_user', 'db_password');
add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_2', 'db_user', 'db_password');
add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_3', 'db_user', 'db_password');
add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_4', 'db_user', 'db_password');
add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_5', 'db_user', 'db_password');
add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_6', 'db_user', 'db_password');
add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_7', 'db_user', 'db_password');
add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_8', 'db_user', 'db_password');
add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_9', 'db_user', 'db_password');
add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_10', 'db_user', 'db_password');
add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_11', 'db_user', 'db_password');
add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_12', 'db_user', 'db_password');
add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_13', 'db_user', 'db_password');
add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_14', 'db_user', 'db_password');
add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_15', 'db_user', 'db_password');
add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_16', 'db_user', 'db_password');

add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_vip', 'db_user', 'db_password');
//------------------------------------------------------------------------//
//---VIP Blogs------------------------------------------------------------//
//------------------------------------------------------------------------//
// Usage: add_vip_blog(BLOG_ID, DS)
// EX: add_vip_blog(1, 'vip1');

add_vip_blog(1, 'dc1');

  • Todd

    Thanks, but no luck. Made the following change:

    add_db_server('home', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'XXXXXX_vip', 'db_user', 'db_pass');
    //------------------------------------------------------------------------//
    //---VIP Blogs------------------------------------------------------------//
    //------------------------------------------------------------------------//
    // Usage: add_vip_blog(BLOG_ID, DS)
    // EX: add_vip_blog(1, 'vip1');

    add_vip_blog(1, 'vip');

    I'm trying a fresh install...during the install I configure the vip database on the install screen. When I press "Submit" I get the following error:

    Fatal error: Cannot redeclare class wpdb in /home/XXXXX/public_html/wp-content/db.php on line 76

    A config.php file is creted in root with the proper informaiton for the vip database...I'm assuming that should happen?

    I know I'm missing something simple here...do I need to name the database "home" instead of "vip"...seems that shoundn't matter, but just grasping at straws now...thanks for the tips.

  • ron_r (aka Mr. Andrea)

    Also, you database declarations are not correct:

    add_db_server('0', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_1', 'db_user', 'db_password');
    add_db_server('1', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_2', 'db_user', 'db_password');
    add_db_server('2', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_3', 'db_user', 'db_password');
    add_db_server('3', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_4', 'db_user', 'db_password');
    ...
    add_db_server('f', 'dc1', 1, 1,'127.0.0.1','127.0.0.1', 'acct_name_16', 'db_user', 'db_password');

  • Todd

    luke and ron,

    Thanks a million. That did it. I installed normally, moved blog 1 tables to the vip db, moved the other tables to the global db, changed the declarations to 0 through f and it worked. I added some blogs and it looks like they are being properly added to the db's. One plugin that worked before but doesn't seem to work now is the Forums plugin from here, but that's no big deal.

    Thanks again. Now for some heavy testing just to make sure there are no other glitches.