Get "Could not connect to mysql" with move-blogs.php for multi-db setup

After following the instructions for multi-db setup, I try and go to the move-blogs.php and get the following error: "Could not connect to mysql"

Does anyone know how to fix?

  • cartier247

    I'm not sure if the screen shot got uploaded. Here is a part of the db-config file:

    <?php
    // Plugin Name: Multi-DB
    // Plugin URI: https://premium.wpmudev.org/project/Multiple-Databases
    // Author: Andrew Billits (Incsub)
    // Version: 2.9.2
    //------------------------------------------------------------------------//
    //---DB Scaling-----------------------------------------------------------//
    //------------------------------------------------------------------------//
    // 16,256,4096
    define ('DB_SCALING', '4096');
    //------------------------------------------------------------------------//
    //---DC IPs---------------------------------------------------------------//
    //------------------------------------------------------------------------//
    // Usage: add_dc_ip(IP, DC)
    // EX: add_dc_ip('123.123.123.', 'dc1');
    add_dc_ip('216.70.96.87', '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('wordpress_b_global');
    //------------------------------------------------------------------------//
    //---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,'','216.70.96.871', 'wordpress_b_global', 'admin', 'pwd');

    add_db_server('000', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_000', 'admin', 'pwd');
    add_db_server('001', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_001', 'admin', 'pwd');
    add_db_server('002', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_002', 'admin', 'pwd');
    add_db_server('003', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_003', 'admin', 'pwd');
    add_db_server('004', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_004', 'admin', 'pwd');
    add_db_server('005', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_005', 'admin', 'pwd');
    add_db_server('006', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_006', 'admin', 'pwd');
    add_db_server('007', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_007', 'admin', 'pwd');
    add_db_server('008', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_008', 'admin', 'pwd');
    add_db_server('009', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_009', 'admin', 'pwd');
    add_db_server('00a', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_00a', 'admin', 'pwd');
    add_db_server('00b', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_00b', 'admin', 'pwd');
    add_db_server('00c', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_00c', 'admin', 'pwd');
    add_db_server('00d', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_00d', 'admin', 'pwd');
    add_db_server('00e', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_00e', 'admin', 'pwd');
    add_db_server('00f', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_00f', 'admin', 'pwd');
    add_db_server('010', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_010', 'admin', 'pwd');
    add_db_server('011', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_011', 'admin', 'pwd');
    add_db_server('012', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_012', 'admin', 'pwd');
    add_db_server('013', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_013', 'admin', 'pwd');
    add_db_server('014', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_014', 'admin', 'pwd');
    add_db_server('015', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_015', 'admin', 'pwd');
    add_db_server('016', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_016', 'admin', 'pwd');
    add_db_server('017', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_017', 'admin', 'pwd');
    add_db_server('018', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_018', 'admin', 'pwd');
    add_db_server('019', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_019', 'admin', 'pwd');
    add_db_server('01a', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_01a', 'admin', 'pwd');
    add_db_server('01b', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_01b', 'admin', 'pwd');
    add_db_server('01c', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_01c', 'admin', 'pwd');
    add_db_server('01d', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_01d', 'admin', 'pwd');
    add_db_server('01e', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_01e', 'admin', 'pwd');
    add_db_server('01f', 'dc1', 1, 1,'','216.70.96.87', 'wordpress_b_01f', 'admin', 'pwd');

  • cartier247

    Here is the move-blogs.php file:

    ?php
    /*
    Plugin Name: Multi-DB (Conversion Tool)
    Plugin URI: https://premium.wpmudev.org/project/Multiple-Databases
    Description:
    Author: Ron Dillehay - FanMail to rdillehay@hotmail.com (no tech support please) - Modified slightly by Andrew Billits (Incsub)
    Version: 2.9.2
    Author URI:
    Descriptiom:
    This script is to move blogs from a wordpress mu single database setup, to a wordpress mu multiple database setup using an MD5 hash to establish blog routing
    Use this script at your own risk. My test setup uses php 5, mysql 5, and wordpress mu 1.2.5a
    */

    //------------------------------------------------------------------------//
    //---Config---------------------------------------------------------------//
    //------------------------------------------------------------------------//

    ///DB Settings
    $dbname = "wordpress_b"; //This is your current database
    $blog_table_prefix = 'wp_'; //Prefix of your wpmu blog tables, most likely this won't need to be changed
    $newdb_prefix = 'wordpress_b_'; //This is the prefix of the db's you're moving your tables into - we assume they are all the same, if not, you're in trouble

    //We need info to connect to the databases
    $dbhost = 'localhost';
    $dbuname = 'admin';
    $dbpass = 'pwd';

    //How many db's are you moving into (16, 256, or 4096)?
    $db_scaling = '4096';

    //------------------------------------------------------------------------//
    ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>

    <title>Multiple Databases Conversion Tool</title>
    <head>
    <style type="text/css">
    table.stats
    {text-align: center; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif ; font-weight: normal;font-size: 12px;color: #fff;width: 750px;background-color: #666;border: 1px solid #555;border-collapse: collapse;border-spacing: 1px;}
    table.stats td
    {background-color: #CCC;color: #000;padding: 6px;text-align: left;border: 1px #fff solid;}
    table.stats td.head
    {background-color: #666;color: #fff;padding: 6px;text-align: center;border-bottom: 2px #fff solid;font-size: 12px;font-weight: bold;}
    </style>
    </head>