Verifying db-config, please

Step 3: db-config.php
#1 Line 10: if you are using 16 do you leave this line alone. I'm assuming yes, but I'd rather verify this too.

#2 Line 16: currently looks like: add_dc_ip('127.0.0.', 'dc1'); changing to: add_dc_ip('173.247.000.1', 'dc1');
Do I leave 'dc1'?

#3 Line 25: Do we add _global to our db name. EX: restrell_global

Below is how lines 65 and below looks, with the only change per line the restrell_1, _2 and so on. Is this correct? The example shows 'masonjan_dbname_0. The masonjan is confusing.

add_db_server('0', 'dc1', 1, 1,'','173.247.000.1', 'restrell_0', 'username', 'password');

Line #63: I changes to:
add_db_server('global', 'dc1', 1, 1,'','173.247.000.1', 'restrella_global', 'username', 'password');

Are these the correct changes, assuming the IP and username and password are correct?

Thank you,

In the example bd-config-sample-16.php, shouldn't the IP address in line 16 match in the add_db_server lines? Meaning the 192.168.0.101 should be the same as the numbers on line #16. Am I correct or have I missed something else?
add_db_server('0', 'dc1', 1, 1,'64.120.23.72','192.168.0.101', 'wpmu_0', 'db_user_name', 'db_user_name_pass');

  • Barry

    In the example bd-config-sample-16.php, shouldn't the IP address in line 16 match in the add_db_server lines? Meaning the 192.168.0.101 should be the same as the numbers on line #16. Am I correct or have I missed something else?
    add_db_server('0', 'dc1', 1, 1,'64.120.23.72','192.168.0.101', 'wpmu_0', 'db_user_name', 'db_user_name_pass');

    One of the IP addresses should be an external WAN IP address if one exists, and the other the local IP address (which is the case in the example above) - if you don't have an external IP address then put the local one in both (and vice versa).

  • Larry_D

    Thanks, I now get to the
    Houston, we have a problem!
    Looks like you need to create your new db's! If you're lucky, this link still works - click me
    Database Error: Access denied for user 'restrell_zmedia'@'localhost' to database 'restrell_global'
    Click on link takes me to http://www.station193.com/ip.gif, Access to content by IP address is not allowed. Please type domain name instead. ?????

    My original dbase for wp is restrell_zm1
    My new dbases; restrell_(generated)x16

    dp-config.php
    Line 16: add_dc_ip('173.247.249.', 'dc1');
    Line 25: add_global_table('restrell');
    Line 63: add_db_server('global', 'dc1', 1, 1,'173.247.249.','173.247.249.', 'restrell_global', 'zmedia', 'password');

    Line 65: add_db_server('0', 'dc1', 1, 1,'173.247.249.','173.247.249.', 'restrell_0', 'zmedia', 'username');

    HELP? Does that sound desperate. :^)

    Once I get through this, I'll be an expert. Luckily this is a test site and nothing critical is lost, but time and pride. Thanks in advance for any assistance.

    ___________
    At this point the website to totally down. With the following error message.
    Warning: mysql_get_server_info(): supplied argument is not a valid MySQL-Link resource in /home/restrell/public_html/wp-content/db.php on line 669

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

  • Barry

    You need a global database (either called _global or just use the one you originally had for your single db install) and 16 new databases (if you are using a 16 db system).

    You need to create all the databases, create a user and assign rights to each of the databases for the user. You can then set up your db config file and run the move-scripts file to move the tables to the correct locations.

  • Larry_D

    OK, I created a database called global and I no longer have an error when i run the move-blog script.

    #4 To start the copy process click here. When I click it I get a new error.
    Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/restrell/public_html/wp-content/scripts/move-blogs.php on line 140

    I've created the 16 new databases with all rights.

  • Larry_D

    Sorry, true, I was following the flow of this specific post as we've referred to line already.

    <?php
    // Plugin Name: Multi-DB
    // Plugin URI: https://premium.wpmudev.org/project/Multiple-Databases
    // Author: Andrew Billits (Incsub), S H Mohanjith (Incsub)
    // Version: 2.9.2
    //------------------------------------------------------------------------//
    //---DB Scaling-----------------------------------------------------------//
    //------------------------------------------------------------------------//
    // 16,256,4096
    define ('DB_SCALING', '16');
    //------------------------------------------------------------------------//
    //---DC IPs---------------------------------------------------------------//
    //------------------------------------------------------------------------//
    // Usage: add_dc_ip(IP, DC)
    // EX: add_dc_ip('123.123.123.', 'dc1');
    add_dc_ip('173.247.249.', '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('affiliatedata');
    add_global_table('affiliatereferrers');
    add_global_table('am_actions');
    add_global_table('am_queue');
    add_global_table('am_schedule');
    add_global_table('autoblog');

    add_global_table('bp_activity');
    add_global_table('bp_activity_meta');
    add_global_table('bp_friends');
    add_global_table('bp_groups');
    add_global_table('bp_groups_groupmeta');
    add_global_table('bp_groups_members');
    add_global_table('bp_messages_messages');
    add_global_table('bp_messages_notices');

    add_global_table('bp_messages_recipients');
    add_global_table('bp_notifications');
    add_global_table('bp_user_blogs');
    add_global_table('bp_user_blogs_blogmeta');
    add_global_table('bp_xprofile_data');
    add_global_table('bp_xprofile_fields');
    add_global_table('bp_xprofile_groups');

    add_global_table('domain_mapping');

    //------------------------------------------------------------------------//
    //---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
    // EX: add_db_server('global', 'dc1', 1, 1,'global.mysql.example.com:3509','global.mysql.example.lan:3509', 'global-db', 'globaluser', 'globalpassword');
    add_db_server('global', 'dc1', 1, 1,'173.247.249.5','173.247.249.5', 'restrell_global', 'zmedia', 'password');

    add_db_server('0', 'dc1', 1, 1,'173.247.249.5','173.247.249.5', 'restrell_0', 'zmedia', 'password');
    add_db_server('1', 'dc1', 1, 1,'173.247.249.5','173.247.249.5', 'restrell_1', 'zmedia', 'password');
    add_db_server('2', 'dc1', 1, 1,'173.247.249.5','173.247.249.5', 'restrell_2', 'zmedia', 'password');
    add_db_server('3', 'dc1', 1, 1,'173.247.249.5','173.247.249.5', 'restrell_3', 'zmedia', 'password');
    add_db_server('4', 'dc1', 1, 1,'173.247.249.5','173.247.249.5', 'restrell_4', 'zmedia', 'password');
    add_db_server('5', 'dc1', 1, 1,'173.247.249.5','173.247.249.5', 'restrell_5', 'zmedia', 'password');
    add_db_server('6', 'dc1', 1, 1,'173.247.249.5','173.247.249.5', 'restrell_6', 'zmedia', 'password');
    add_db_server('7', 'dc1', 1, 1,'173.247.249.5','173.247.249.5', 'restrell_7', 'zmedia', 'password');
    add_db_server('8', 'dc1', 1, 1,'173.247.249.5','173.247.249.5', 'restrell_8', 'zmedia', 'password');
    add_db_server('9', 'dc1', 1, 1,'173.247.249.5','173.247.249.5', 'restrell_9', 'zmedia', 'password');
    add_db_server('a', 'dc1', 1, 1,'173.247.249.5','173.247.249.5', 'restrell_a', 'zmedia', 'password');
    add_db_server('b', 'dc1', 1, 1,'173.247.249.5','173.247.249.5', 'restrell_b', 'zmedia', 'password');
    add_db_server('c', 'dc1', 1, 1,'173.247.249.5','173.247.249.5', 'restrell_c', 'zmedia', 'password');
    add_db_server('d', 'dc1', 1, 1,'173.247.249.5','173.247.249.5', 'restrell_d', 'zmedia', 'password');
    add_db_server('e', 'dc1', 1, 1,'173.247.249.5','173.247.249.5', 'restrell_e', 'zmedia', 'password');
    add_db_server('f', 'dc1', 1, 1,'173.247.249.5','173.247.249.5', 'restrell_f', 'zmedia', 'password');
    //------------------------------------------------------------------------//
    //---VIP Blogs------------------------------------------------------------//
    //------------------------------------------------------------------------//
    // Usage: add_vip_blog(BLOG_ID, DS)
    // EX: add_vip_blog(1, 'vip1');

    ?>

    My original database to launch wp:
    DB_NAME: restrell_zm1
    DB_USER: restrell_zmedia

    The new databases are also named
    DB_NAME: restrell_(0) x16 code generated
    DB_USER: same as above

    Also created a global database
    DB_NAME: restrell_global
    DB_NAME: same as above

    _____stop_____

    All databases have full rights. Verified

    _____stop_____

    move-blogs.php
    ///DB Settings
    $dbname = "restrell_zm1"; //This is your current database
    $blog_table_prefix = 'wp_2'; //Prefix of your wpmu blog tables, most likely this won't need to be changed
    $newdb_prefix = 'restrell_'; //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 = 'restrell_zmedia';
    $dbpass = 'password';

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

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

    ____stop_____________

    I my original wp-config file I gave the table pefix of $table_prefix = 'wp_2';

    I'm certain i've done something stupid. Getting ready to whip the slate clean and do a detailed step by step outline of what I'm doing.

  • devex

    I'm going through pretty much the same grief here because the instructions for this are so ambiguous.

    At present my move-blogs.php is throwing up:-

    "Database Error: Access denied for user ''xxxxx'@'%' to database 'zzzzz_c'

    (data obfuscated)

    Well, user xxxxx'@'% doesn't exist so that's got me stumped!

    I have an existing database with existing tables, not some blank global one without tables (how is that possible anyway - a Wordpress database without tables - or do we set up an additional blank database IN ADDITION to the existing one with tables? If so we'd end up with 18 tables for a supposedly 16 table setup correct?). Do we use IPs or specific localhost:port addresses? Why a 3 block IP at add_dc_ip and not 4 (or is it 4 anyway - comments here show 3, the instructions show 4). The comment above:-

    "Line 25: add_global_table('restrell');
    Do you have a table in your global database called wp_restrell? If not then that line shouldn't be there."

    Well, I thought the instruction was to add the table so it shouldn't be there anyway!

    I'm really and truly lost. Can something please give a clear and unambiguous set of visual instructions for what should be a relatively simple setup.

  • Jack Kitterhing

    Hi there @devex,

    Hope you're well today and thanks for your question.

    Sorry about the delay here, could you start a new thread here please https://premium.wpmudev.org/forums/#question and we'd be happy to assist.

    Just there are possible different hosting configurations and all the others in this thread with continue to get post notifications :slight_smile:

    Thanks for your understanding.

    Kind Regards
    Jack.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.