Houston, we have a problem! Setting up Multi-DB with your support.

Hello guys, Merry Christmas (albeit late )
I hope that you are all well. I am (in case you wonder)

Issue
Try to set up Multi-DB on ADDON DOMAIN.

I have followed the tutorial instructions found on your website and I got the following error:

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 'site_user'@'localhost' to database 'site_devsitedb'

When I hit “click me” I get a 404 not found page

Background
Using shared web hosting service, WP3.8 installed in root folder, Multisite subfolders, buddypress installed as second blog.
Main site (live site): site.com
Second site (ADDON DOMAIN, development site): devsite.com

127.0.0.1 localhost
12.222.222.222 devsite.com

Note:
12.222.222.222 is a fictitious IP address for the purpose of this explanation.

Wp-config.php (ADDON DOMAIN, devsite.com)
define('DB_NAME', 'site_devsitedb');

My note: when I create a new database using cPanel, mySQL Databases, the database name prefix is equal to the domain name (site_). Hence database name: site_devsitedb

define('DB_USER', 'site_user');
define('DB_PASSWORD', 'xxx');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
$table_prefix = 'wp_';

Let’s begin!

STEP 1
I want to create 16DB

STEP 2
1. Select the DB SQL link and type your database name (same name as your default WordPress DB) followed by an underscore (_). Choose the number of databases and click “Submit”. DONE!

DB Name: devsitedb_

2. I don’t need to create VIP databases

3. Now, you need to create the databases either via command line (hardcore) or through phpMyAdmin. Log into your server and if you’re using phpMyAdmin you’ll enter the instructions generated above here. DONE!

4. One final step is to make sure you have assigned a username and password to be associated with each database. DONE!

My note:
I have added site_user to all 16DB using cPanel, MySQL Databases.
I have granted all privileges when adding site_user to the databases.

STEP 3
Now that are databases are created and in place, it’s time to start configuring the plugin to handle the heavy lifting. We’ve got 5 separate areas to configure here (6 if you’re using VIP databases)

Line 10: Change the DB_SCALING to however many databases you’re using (16). DONE!

Line 16: Don’t let this scare you. It just needs your server’s IP address.
Question: What server IP address should I put in Line 16? (please see IP Addresses provided in the background paragraph above for more information).

Line 25: Provide the same name you assigned for your global database in Step 2. example ‘dbname_global’
Observation - This is confusing. In STEP 2 to I have created the devsitedb_ database as per tutorial instructions. Not devsitedb_global

Question: could you please advise what I should put in Line
25?

Fill in your DB Name: (same as in step 2), Your DB Username and Password, For DB Local Host enter you server IP again. If you’re using a Remote Host enter that here, if you’re not just leave it blank. Finally select the number of databases you created and click “Submit”.

Observation – the statement “For DB Local Host enter you server IP again. If you’re using a Remote Host enter that here, if you’re not just leave it blank.” is confusing.

Question – given the information contained in the background paragraph above, what should I type in the form below?

DB Name:
DB User:
DB Pass:
DB Local Host:
DB Remote Host:

4. You’ll want to copy and past these lines directly above the commented out “VIP Blogs” section. DONE!

5. Finally, we’ll add the line for our global database, directly above the lines you just pasted. Assuming you used “global” for your global database.
Observation – the statement “Assuming you used “global” for your global database.” is confusing.
Question – how do I know whether I am using “global” for my global database?

The main database is devsitedb from which I have created a new database devsitedb_, (underscore) as instructed in STEP 2.1 in the Multi-DB tutorial.
I then run your script which created lines of code that I have run in myPHPAdmn SQL to generate 16 new database site_devsitedb_0, site_devsitedb_1, site_devsitedb_2, etc.

Given the information that I have given you so far in this post, could you please clarify what goes in between quotation marks in the code below, which precedes the 16 lines of codes, one for the newly created database?

add_db_server('global', 'dc1', 1, 1,'remotehost','localhost', 'dbname_global', 'dbuser', 'dbpass');

STEP 4
1. Open move-blogs.php and scroll down to line 19 for the Config section. DONE!

2. Configure lines 19-29 with the correct information as asked for in the file. DONE!

Remember that these configurations are all for your original WordPress database – not the new ones we are creating.
Observation – the statement “Remember that these configurations are all for your original WordPress database – not the new ones we are creating.” is confusing.

Given the information that I have given you so far in this post, could you please clarify what goes in between quotation marks in the code below?

///DB Settings
$dbname = '';
$blog_table_prefix = 'wp_';
$newdb_prefix = '';

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

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

Conclusion
Well, thank you for reading. And I hope my questions make sense. If you prefer to take this post off-line you can emal bzarro76[at]gmail[dot]com

Thank you for providing one of the best support and service that I have ever experienced in the last few years. Best wishes, the fixer.

For completion of information I have attached move-blogs.php and db-config.php code below.

move-blogs.php

///DB Settings
$dbname = 'site_devsitedb'; //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 = 'site_devsitedb'; //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 = 'site_user';
$dbpass = 'xxx';

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

db-config.php

//------------------------------------------------------------------------//
//---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('127.0.0.1', '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('site_devsitedb');
//------------------------------------------------------------------------//
//---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,'','127.0.0.1', 'site_devsitedb', 'site_user', 'xxx');

add_db_server('0', 'dc1', 1,1,'','127.0.0.1', 'site_devsitedb_0', 'site_user', 'xxx');
add_db_server('1', 'dc1', 1,1,'','127.0.0.1', 'site_devsitedb_1', 'site_user', 'xxx');
add_db_server('2', 'dc1', 1,1,'','127.0.0.1', 'site_devsitedb_2', 'site_user', 'xxx');
add_db_server('3', 'dc1', 1,1,'','127.0.0.1', 'site_devsitedb_3', 'site_user', 'xxx');
add_db_server('4', 'dc1', 1,1,'','127.0.0.1', 'site_devsitedb_4', 'site_user', 'xxx');
add_db_server('5', 'dc1', 1,1,'','127.0.0.1', 'site_devsitedb_5', 'site_user', 'xxx');
add_db_server('6', 'dc1', 1,1,'','127.0.0.1', 'site_devsitedb_6', 'site_user', 'xxx');
add_db_server('7', 'dc1', 1,1,'','127.0.0.1', 'site_devsitedb_7', 'site_user', 'xxx');
add_db_server('8', 'dc1', 1,1,'','127.0.0.1', 'site_devsitedb_8', 'site_user', 'xxx');
add_db_server('9', 'dc1', 1,1,'','127.0.0.1', 'site_devsitedb_9', 'site_user', 'xxx');
add_db_server('a', 'dc1', 1,1,'','127.0.0.1', 'site_devsitedb_a', 'site_user', 'xxx');
add_db_server('b', 'dc1', 1,1,'','127.0.0.1', 'site_devsitedb_b', 'site_user', 'xxx');
add_db_server('c', 'dc1', 1,1,'','127.0.0.1', 'site_devsitedb_c', 'site_user', 'xxx');
add_db_server('d', 'dc1', 1,1,'','127.0.0.1', 'site_devsitedb_d', 'site_user', 'xxx');
add_db_server('e', 'dc1', 1,1,'','127.0.0.1', 'site_devsitedb_e', 'site_user', 'xxx');
add_db_server('f', 'dc1', 1,1,'','127.0.0.1', 'site_devsitedb_f', 'site_user', 'xxx');