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’:wink:; changing to: add_dc_ip(‘173.247.000.1’, ‘dc1’:wink:;

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’:wink:;

Line #63: I changes to:

add_db_server(‘global’, ‘dc1′, 1, 1,”,’173.247.000.1’, ‘restrella_global’, ‘username’, ‘password’:wink:;

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’:wink:;

  • Barry
    • DEV MAN’s Mascot

    #2 Line 16: currently looks like: add_dc_ip(‘127.0.0.’, ‘dc1’:wink:; changing to: add_dc_ip(‘173.247.000.1’, ‘dc1’:wink:;

    Do I leave ‘dc1’?

    That’s incorrect should be changed to:

    add_dc_ip('173.247.000.', 'dc1');

  • Barry
    • DEV MAN’s Mascot

    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’:wink:;

    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
    • Site Builder, Child of Zeus

    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’:wink:;

    Line 25: add_global_table(‘restrell’:wink:;

    Line 63: add_db_server(‘global’, ‘dc1′, 1, 1,’173.247.249.’,’173.247.249.’, ‘restrell_global’, ‘zmedia’, ‘password’:wink:;

    Line 65: add_db_server(‘0’, ‘dc1′, 1, 1,’173.247.249.’,’173.247.249.’, ‘restrell_0’, ‘zmedia’, ‘username’:wink:;

    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

  • Larry_D
    • Site Builder, Child of Zeus

    Let me ask this question now that I’ve combed the instructions several time. As part of step #2 do you also need to create a global dbase? So it would look like this: restrell_global

    CREATE DATABASE dbname_global DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

    I just don’t see what I’m missing. Time for a short break.

  • Barry
    • DEV MAN’s Mascot

    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
    • Site Builder, Child of Zeus

    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
    • Site Builder, Child of Zeus

    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://wpmudev.com/project/Multiple-Databases

    // Author: Andrew Billits (Incsub), S H Mohanjith (Incsub)

    // Version: 2.9.2

    //


    //

    //—DB Scaling


    //

    //


    //

    // 16,256,4096

    define (‘DB_SCALING’, ’16’:wink:;

    //


    //

    //—DC IPs


    //

    //


    //

    // Usage: add_dc_ip(IP, DC)

    // EX: add_dc_ip(‘123.123.123.’, ‘dc1’:wink:;

    add_dc_ip(‘173.247.249.’, ‘dc1’:wink:;

    //


    //

    //—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’:wink:;

    add_global_table(‘affiliatedata’:wink:;

    add_global_table(‘affiliatereferrers’:wink:;

    add_global_table(‘am_actions’:wink:;

    add_global_table(‘am_queue’:wink:;

    add_global_table(‘am_schedule’:wink:;

    add_global_table(‘autoblog’:wink:;

    add_global_table(‘bp_activity’:wink:;

    add_global_table(‘bp_activity_meta’:wink:;

    add_global_table(‘bp_friends’:wink:;

    add_global_table(‘bp_groups’:wink:;

    add_global_table(‘bp_groups_groupmeta’:wink:;

    add_global_table(‘bp_groups_members’:wink:;

    add_global_table(‘bp_messages_messages’:wink:;

    add_global_table(‘bp_messages_notices’:wink:;

    add_global_table(‘bp_messages_recipients’:wink:;

    add_global_table(‘bp_notifications’:wink:;

    add_global_table(‘bp_user_blogs’:wink:;

    add_global_table(‘bp_user_blogs_blogmeta’:wink:;

    add_global_table(‘bp_xprofile_data’:wink:;

    add_global_table(‘bp_xprofile_fields’:wink:;

    add_global_table(‘bp_xprofile_groups’:wink:;

    add_global_table(‘domain_mapping’:wink:;

    //


    //

    //—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’:wink:;

    //

    // 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’:wink:;

    add_db_server(‘global’, ‘dc1′, 1, 1,’173.247.249.5′,’173.247.249.5’, ‘restrell_global’, ‘zmedia’, ‘password’:wink:;

    add_db_server(‘0’, ‘dc1′, 1, 1,’173.247.249.5′,’173.247.249.5’, ‘restrell_0’, ‘zmedia’, ‘password’:wink:;

    add_db_server(‘1’, ‘dc1′, 1, 1,’173.247.249.5′,’173.247.249.5’, ‘restrell_1’, ‘zmedia’, ‘password’:wink:;

    add_db_server(‘2’, ‘dc1′, 1, 1,’173.247.249.5′,’173.247.249.5’, ‘restrell_2’, ‘zmedia’, ‘password’:wink:;

    add_db_server(‘3’, ‘dc1′, 1, 1,’173.247.249.5′,’173.247.249.5’, ‘restrell_3’, ‘zmedia’, ‘password’:wink:;

    add_db_server(‘4’, ‘dc1′, 1, 1,’173.247.249.5′,’173.247.249.5’, ‘restrell_4’, ‘zmedia’, ‘password’:wink:;

    add_db_server(‘5’, ‘dc1′, 1, 1,’173.247.249.5′,’173.247.249.5’, ‘restrell_5’, ‘zmedia’, ‘password’:wink:;

    add_db_server(‘6’, ‘dc1′, 1, 1,’173.247.249.5′,’173.247.249.5’, ‘restrell_6’, ‘zmedia’, ‘password’:wink:;

    add_db_server(‘7’, ‘dc1′, 1, 1,’173.247.249.5′,’173.247.249.5’, ‘restrell_7’, ‘zmedia’, ‘password’:wink:;

    add_db_server(‘8’, ‘dc1′, 1, 1,’173.247.249.5′,’173.247.249.5’, ‘restrell_8’, ‘zmedia’, ‘password’:wink:;

    add_db_server(‘9’, ‘dc1′, 1, 1,’173.247.249.5′,’173.247.249.5’, ‘restrell_9’, ‘zmedia’, ‘password’:wink:;

    add_db_server(‘a’, ‘dc1′, 1, 1,’173.247.249.5′,’173.247.249.5’, ‘restrell_a’, ‘zmedia’, ‘password’:wink:;

    add_db_server(‘b’, ‘dc1′, 1, 1,’173.247.249.5′,’173.247.249.5’, ‘restrell_b’, ‘zmedia’, ‘password’:wink:;

    add_db_server(‘c’, ‘dc1′, 1, 1,’173.247.249.5′,’173.247.249.5’, ‘restrell_c’, ‘zmedia’, ‘password’:wink:;

    add_db_server(‘d’, ‘dc1′, 1, 1,’173.247.249.5′,’173.247.249.5’, ‘restrell_d’, ‘zmedia’, ‘password’:wink:;

    add_db_server(‘e’, ‘dc1′, 1, 1,’173.247.249.5′,’173.247.249.5’, ‘restrell_e’, ‘zmedia’, ‘password’:wink:;

    add_db_server(‘f’, ‘dc1′, 1, 1,’173.247.249.5′,’173.247.249.5’, ‘restrell_f’, ‘zmedia’, ‘password’:wink:;

    //


    //

    //—VIP Blogs


    //

    //


    //

    // Usage: add_vip_blog(BLOG_ID, DS)

    // EX: add_vip_blog(1, ‘vip1’:wink:;

    ?>

    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.

  • Mason
    • DEV MAN’s Sidekick

    Hiya Larry_D,

    Did you give this one another go? It’s been awhile since We’ve heard from ya so I’m gonna mark this one as resolved. If ya like, feel free to re-open this one or start a new one so we can help ya further.

    Thanks!

  • devex
    • Flash Drive

    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’:wink:;

    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.