Multi-Db installation

Hello,

I have installed Multi-DB (4096). After triple check (installation, procedure),I have moved blogs. Everything is okay. I have checked PhpAdmin, the blogs are there. Unfortunately when I go to my url http://www.mysite.com, I got this error :

Warning: mysql_get_server_info(): supplied argument is not a valid MySQL-Link resource in /home/mysite/www/wp-content/db.php on line 669

Warning: Cannot modify header information - headers already sent by (output started at /home/mysite/www/wp-content/db.php:669) in /home/mysite/www/wp-includes/functions.php on line 3191
Error establishing a database connection

I have to delete the file db.php, and then my site is visible. I would need your expertise please...

  • antKat
    • HummingBird

    Hi Christop2,
    Did you check to see if there were any blank lines before or after the php tags? I had a simila error caused by extra blank lines on a php file.

    I am just about to migrate and install multiple-db 4096 as well. I've been actually trying to find someone to do this for me; no luck. How painful was it to this point?

  • christop2
    • WPMU DEV Initiate

    Hi Barry,

    Thank you very much for your help. Below the file :

    define ('DB_SCALING', '4096');
    //------------------------------------------------------------------------//
    //---DC IPs---------------------------------------------------------------//
    //------------------------------------------------------------------------//
    // Usage: add_dc_ip(IP, DC)
    // EX: add_dc_ip('123.123.123.', 'dc1');
    add_dc_ip('46.105.404.207', 'dc1');
    //------------------------------------------------------------------------//
    //---Global Tables--------------------------------------------------------//
    //------------------------------------------------------------------------//
    // Do not include default global tables
    // Leave off base prefix (eg: wp_)
    //
    // Usage: add_global_table(TABLE_NAME)
    // EX: add_global_table('something');
    add_global_table('hmd2410_table');
    //------------------------------------------------------------------------//
    //---DB Servers-----------------------------------------------------------//
    //------------------------------------------------------------------------//
    // Database servers grouped by dataset.
    // R can be 0 (no reads) or a positive integer indicating the order
    // in which to attempt communication (all locals, then all remotes)
    //
    // Usage: add_db_server(DS, DC, READ, WRITE, HOST, LAN_HOST, NAME, USER, PASS)
    // EX: add_db_server('global', 'dc1', 1, 1,'global.mysql.example.com:3509','global.mysql.example.lan:3509', 'global-db', 'globaluser', 'globalpassword');
    //
    // Note: you can also place this section in a file called db-list.php in wp-content

    add_db_server('global', 'dc1', 1, 1,'','localhost', 'loloblogsn_global', 'pol', 'Cheeses404');
    add_db_server('000', 'dc1', 1, 1,'','localhost', 'lolblogsn_000', 'pol', ' Cheeses404');
    add_db_server('001', 'dc1', 1, 1,'','localhost', lolpblogsn_001', 'pol', ' Cheeses404');

    Please note :

    - I changed prefix wp_ to hmd2410_ I am not sure about global table ? I put hmd2410_table ?
    - Previously I put my IP instead of localhost, but it doesn't work. I couldn't move the blogs

  • Barry
    • DEV MAN’s Mascot

    Ok

    add_dc_ip('46.105.404.207', 'dc1');

    Is wrong - you've got too many parts to the IP address there, should only be the first three - see the example in the line above.

    add_global_table('hmd2410_table');

    is wrong unless you have a table called wp_hmd2410_table somewhere in your database or hmd2410_table even - if not then just delete that line.

    add_db_server('global', 'dc1', 1, 1,'','localhost', 'loloblogsn_global', 'pol', 'Cheeses404');

    Can you change the '' to 'localhost' if you don't want to specify an external host name - that should be on all lines for the databases

  • christop2
    • WPMU DEV Initiate

    thanks for your quick reply :

    - ok for the IP, I'll mention the first three only
    - Please note my prefix is hmd2410_ So I only mention hmd2410_ Is it correct ?
    - I have no external host name - so I just specify my IP - Also the first three or the full Ip ?

    Please confirm

  • Barry
    • DEV MAN’s Mascot

    - Please note my prefix is hmd2410_ So I only mention hmd2410_ Is it correct ?

    Yep, noted that - if you don't have a global table called hmd2410_table then that line has to go.

    I have no external host name - so I just specify my IP - Also the first three or the full Ip ?

    Nope, put localhost in there like i said - if you don't have an external host name, you should mirror the local one and localhost will do just fine :slight_smile:

  • christop2
    • WPMU DEV Initiate

    Hi Barry,

    I have tried to uninstall and install again, test and test again. Everything works fine - my site is available : the script populated the tables (attached picture) but I still have these errors when I execute move-blogs.php (attached picture). When I refresh the page, the errors disappear.

    So, do you think it is okay ? If so, I will try in real life...

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.