Howdy, is this plugin compatible with the latest WPMU version? Is it still working? Thanks everyone!
]]>Hello, i tried using your plugin. It’s working fine. But aren’t closing the connections after being finished, and continue to create new ones. This cause max_user_connections limit error. The limit of max_user_connections i’m using is 128, the DBs are 16 + the global one.
]]>hi, I’m having a multisite install with 500+ subsites and hoping for more, so i need multiple databases, does this work with current version of wp or v5.5+ .please let me know because i cannot find the detailed installation page
]]>It looks like the delete_expired_transients() function was added in WordPress 4.9, and I think the SharDB get_table_from_query() function fails to pull the correct sharded database for the table. Instead, delete_expired_transients() checks the global table for every blog, and the transient tables don’t exist in the global table.
Error logs show errors like:
WordPress database error Table ‘wp_global.wp_517_options’ doesn’t exist for query DELETE a, b FROM wp_517_options a, wp_517_options b\n\t\t\tWHERE a.option_name LIKE ‘\\\\_transient\\\\_%’\n\t\t\tAND a.option_name NOT LIKE ‘\\\\_transient\\\\_timeout\\\\_%’\n\t\t\tAND b.option_name = CONCAT( ‘_transient_timeout_’, SUBSTRING( a.option_name, 12 ) )\n\t\t\tAND b.option_value < 1516748497 made by do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, delete_expired_transients, SharDB->query
This isn’t a breaking feature (as you can turn off most of the automatic delete_expired_transients checks), but I thought maybe the preg_matches in db.php need to be updated for the way delete_expired_transients calls tables. I don’t know regex well enough to test this, though.
Could this be the cause of the errors?
]]>Hi, have an error
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in /home3/vibrasyonfm/public_html/wp-content/db.php on line 384
Warning: mysqli_errno() expects parameter 1 to be mysqli, boolean given in /home3/vibrasyonfm/public_html/wp-content/db.php on line 385
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in /home3/vibrasyonfm/public_html/wp-content/db.php on line 384
Warning: mysqli_errno() expects parameter 1 to be mysqli, boolean given in /home3/vibrasyonfm/public_html/wp-content/db.php on line 385
Unable to connect to gator3206.hostgator.com:3306 while querying table '' (global_w)
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in /home3/vibrasyonfm/public_html/wp-content/db.php on line 384
Warning: mysqli_errno() expects parameter 1 to be mysqli, boolean given in /home3/vibrasyonfm/public_html/wp-content/db.php on line 385
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in /home3/vibrasyonfm/public_html/wp-content/db.php on line 384
Warning: mysqli_errno() expects parameter 1 to be mysqli, boolean given in /home3/vibrasyonfm/public_html/wp-content/db.php on line 385
Unable to connect to gator3206.hostgator.com:3306 while querying table '' (global_w)
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in /home3/vibrasyonfm/public_html/wp-content/db.php on line 384
Warning: mysqli_errno() expects parameter 1 to be mysqli, boolean given in /home3/vibrasyonfm/public_html/wp-content/db.php on line 385
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'gator3206.hostgator.com:3306' (0) in /home3/vibrasyonfm/public_html/wp-content/db.php on line 358
Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in /home3/vibrasyonfm/public_html/wp-content/db.php on line 384
Warning: mysqli_errno() expects parameter 1 to be mysqli, boolean given in /home3/vibrasyonfm/public_html/wp-content/db.php on line 385
Unable to connect to gator3206.hostgator.com:3306 while querying table 'wp_znns_blogs' (global_r)
Warning: Cannot modify header information - headers already sent by (output started at /home3/vibrasyonfm/public_html/wp-blog-header.php:1) in /home3/vibrasyonfm/public_html/wp-includes/ms-settings.php on line 79
]]>
Hi Ron,
You help in the past with the upgrade and was hoping you could here too. We see to be getting more apache errors not and MySQL crashes do to the plugin failing on some query validation.
We are using the last version you gave us that was mysqlcli compliant.
Any ideas?
—-
[Sat Dec 23 22:09:39.612249 2017] [php7:notice] [pid 5075:tid 140458800797440] [client a.b.c.d:55934] WordPress database error 2017-12-23 22:09:39 Can’t select global
[;
_w – \nArray\n(\n [referrer] => a.b.c.d/\n [host] => localhost\n [error] => \n [errno] => \n [tcp_responsive] => \n)\n for query made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), require(‘wp-includes/ms-settings.php’), ms_load_current_site_and_network, get_site_by_path, get_sites, WP_Site_Query->query, WP_Site_Query->get_sites, WP_Site_Query->get_site_ids, SharDB->_real_escape, SharDB->db_connect
[Sun Dec 24 02:02:02.076650 2017] [php7:notice] [pid 5076:tid 140458709739264] [client f.s.r.d:55450] WordPress database error 2017-12-24 02:02:02 Can’t select global_w – \nArray\n(\n [referrer] => a.b.c.d/\n [host] => localhost\n [error] => \n [errno] => \n [tcp_responsive] => \n)\n for query made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), require(‘wp-includes/ms-settings.php’), ms_load_current_site_and_network, get_site_by_path, get_sites, WP_Site_Query->query, WP_Site_Query->get_sites, WP_Site_Query->get_site_ids, SharDB->_real_escape, SharDB->db_connect-
—–
have buy your ebook online with 10 $ and set up the plugins as commended
16 database is created with same user mapped the migration page is shown properly but after clicking on the migrate global table is shows the report as your picture shows but in database i found no thing happened in global database no changes take place no table is copped and same for the migrate site option is last shows all done message but nothing copped. my set up
is like this
$shardb_hash_length = 1;
$shardb_prefix = ‘edoceo_edoceo_’;
$shardb_dataset = ‘global’;
$enable_home_db = true;
$num_vipdbs = 2;
what is this
/**
* This generates the array of servers.
*
* @param string $ds Dataset: the name of the dataset. Just use “global” if you don’t need horizontal partitioning.
* @param int $part Partition: the vertical partition number (1, 2, 3, etc.). Use “0” if you don’t need vertical partitioning.
* @param string $dc Datacenter: where the database server is located. Airport codes are convenient. Use whatever.
* @param int $read Read order: lower number means use this for more reads. Zero means no reads (e.g. for masters).
* @param bool $write Write flag: is this server writable?
* @param string $host Internet address: host:port of server on internet.
* @param string $lhost Local address: host:port of server for use when in same datacenter. Leave empty if no local address exists.
* @param string $name Database name.
* @param string $user Database user.
* @param string $password Database password.
*/
is there have to set any things?
after placing db.php in wp-content file the error
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host ‘localhost:3306’ (2) in /home/edoceoin/public_html/edoceo.in/assets/db.php on line 358
like this long list of error with almost same error
please guide, hoe to properly installed this plugins
thanks
]]>Hi Ron,
I used SharDB to migrate 12000 blogs to 16 databases. This worked great especially with the clear userguide you wrote. On the testserver the migration went OK and the sites functioned as expected afterwards. However in production the plugin produces an error: shardb fsockopen(): unable to connect to localhost:3306 (Only one usage of each socket address (protocol/network address/port) is normally permitted. Warning: mysqli_errno() expects parameter 1 to be mysqli, boolean given in C:\domains\homeshowdomein.nl\wwwroot\wp-content\db.php on line 385
Unable to connect to localhost:3306 while querying table ‘wp_sitemeta’ (global_w)
This is on a Windows server with a lot of concurrent users. Have you ran into this error before?
Regards,
Sander
I have no experience using this plugin, and I have quick question.
Can I install SharDB when my network is getting bigger?
(Lets say when my subsite reach 1000)
Or do I need to install SharDB from beginning with no subsite?
Thanks a lot.
]]>The current version of this plugin is 2.7.7,, but there is an information in “Changelog” about v2.8
Where can I download the newest version?
]]>Hi – I have wordpress ms installed using mamp (localhost).
How do I configure add_db_server for this environment?
Right now I have tried this but still no luck.
add_db_server( ‘database_name’, 0, ”, 1, 1, ‘localhost’, ‘localhost’, ‘database_name’, DB_USER, DB_PASSWORD);
add_db_server( ‘database_name’, 0, ”, 1, 1, ‘127.0.0.1’, ‘127.0.0.1’, ‘database_name’, DB_USER, DB_PASSWORD);
add_db_server( ‘database_name’, 0, ”, 1, 1, ‘192.168.0.2’, ‘192.168.0.2’, ‘database_name’, DB_USER, DB_PASSWORD);
What am I doing wrong?
]]>Hi,
firstly sorry for my beginner question, but I’m trying to perform a WP multisite where each site has each database, I mean, one site by database, separated databases by each site.
I installed this plugin following all instructions and when I clicked at the button “migrate sites” (or something like this) I saw a log telling that something happen with database, I understood that the tables has been copied but I don’t know where, I just login to the phpmyadmin and nothing changed in there.
Please someone can help me with that two things? First, what exactly this plugin does and if can I use this plugin to separate each site in each database (if it is possible, please tell me how)
Best.
]]>Hi there!
I’ve been looking to have 1 database for each WPMU Blog. I’ve found this plugin but I’m not sure if it can help me achieving this.
I tried to access the installation guide but the URL is broken (https://wpebooks.com/shardb-installation-guide/)
Could you possible confirm if I can use this plugin to split the databases for each blog? Also, can I implement this plugin on a existing WPMU installation?
Thanks a lot for your help!
]]>Hi Ron,
We have finally hit a limit where this plugin is deprecated and the technical debt is to large. Due to it’s dependency on MySQL_connect and php5, I am forced to remove this configuration. When you have a moment, if you are still online, can you confirm the merge process for me?
mysqldump each DB (4096) and restore into 1 new Database
remove wp-content/db.php
confirm wp-config.php db settings
restart Apache and test
Did I miss anything?
]]>Get this error by installing migrating database
Error: You must configure your database settings by adding require('./db-settings.php'); to your /hsphere/local/home/bbblzxh/jounalib.com/wp-config.php for the migration process to work
Hi Ron,
Do you have any plans (or desire) to update db.php to support mysqli (php 7)?
BTW, awesome plugin!
Axel.
]]>Hi Ron,
First, I would like to command you on this awesome plugin.
I am running into the following error “”NOTICE: PHP message: PHP Fatal error: Cannot redeclare add_db_server() (previously declared in /ho**********/db-settings.php:85) in /ho**********/db-settings.php on line 85” and I am wondering if you have any input on a possible fix?
Below is code on line 85:
function add_db_servers($ds, $part, $dc, $read, $write, $host, $lhost, $name, $user, $password) {
global $db_servers, $db_ds_parts;
if ( empty( $lhost ) )
$lhost = $host;
$server = compact(‘ds’, ‘part’, ‘dc’, ‘read’, ‘write’, ‘host’, ‘lhost’, ‘name’, ‘user’, ‘password’);
$db_servers[$ds][$part][] = $server;
$db_ds_parts[$name] = “{$ds}_{$part}”;
}
Hello, I am trying this plugin to split up my database to accommodate a large number of sites. I have configured everything according to the documentation but it seems something is missing. When i try to run the SharDBMigration from settings i get the below error.
Error: You must configure your database settings by adding require(‘./db-settings.php’); to your /var/www/blogs.myblogs.com/wp-config.php for the migration process to work
I have added the below lines to the wp-config.php file but its almost as it it doesn’t see the file.
define(‘DB_COLLATE’, ”);
require(‘db-settings.php’);
define(‘VHOST’, ‘no’);
$base = ‘/’;
define(‘DOMAIN_CURRENT_SITE’, ‘blogs.myblog.com’ );
define(‘PATH_CURRENT_SITE’, ‘/’ );
define(‘BLOGID_CURRENT_SITE’, ‘1’ );
My db-settings.php file changes are below
// how many characters of hexidecimal hash
$shardb_hash_length = 1;
// what is the prefix of your blog database shards (everything before the hexidecimal hash)
$shardb_prefix = ‘myblogs_blogs’;
// set a string to be used as an internal identifier for the dataset
$shardb_dataset = ‘123’;
// do you want to put your primary blog (blog_id 1) in its own ‘home’ database?
$enable_home_db = true;
// how many, if any, VIP databases do you have?
$num_vipdbs = 0;
// add this to set the write master read priority (default 1)
$shardb_master_read = 99;
// add this if all of your databases are on a local server
$shardb_local_db = true;
// use this function to add a read slave host
add_slave($read_priority, $hostname, $local_hostname, $user, $password);
Any help would be appreciated.
]]>I purchased/followed the installation guide and tested SharDB on localhost with 229 sites/16 databases (+ home & global). I had to increase my max_execution_time
, but it all worked fine.
Now I have been trying to set up SharDB on my production site (4,000+ sites) with 256 databases (+ home & global), but it seems like it times out or just stops partway through migrating the global tables. It copied 6 tables successfully, but stops there and doesn’t show the success message and stops loading. (The only difference between my localhost install and the live one is the amount of sites. & I don’t have any errors in my debug log.)
Is there something else I should increase/look at in php.ini
or wp-config.php
?
I have install
db-settings.php inside root folder.
and bd.php inside wp-admin folder
shardb-admin.php inside plugin folder
my main db is
in24home_lms
and other db is
in24home_lms_01
in24home_lms_02
in24home_lms_03
in24home_lms_04
in24home_lms_05
can anyone tell me how i can configure my db-setting file i am not technical mind.
]]>Hi,
I have upgrade my wp site to 4.3. Now shardb showing following error
]]>WordPress database error Table ‘wp_myblog_global.wp_options’ doesn’t exist for query SHOW FULL COLUMNS FROM
wp_options
made by do_action(‘admin_init’), call_user_func_array, bp_admin_init, do_action(‘bp_admin_init’), call_user_func_array, bp_setup_updater, bp_version_updater, bp_version_bump, bp_update_option, update_blog_option, update_option, SharDB->query, referer: https://xxxx.com
My db-settings
$shardb_hash_length = 1;
$shardb_prefix = ‘old_wordpress_’;
$shardb_dataset = ‘wordpress’;
$enable_home_db = true;
$shardb_local_db = true;
data has been migrated into global and home table but when I added db.php file, its shows folloing error..
Notice: SharDB was called incorrectly. SharDB must set a database connection for use with escaping. Please see Debugging in WordPress for more information. (This message was added in version 1024.) in C:\wamp\www\wordpress3_9\wp-includes\functions.php on line 3249
]]>Just noticed that when saving network settings I get this error in some fields
O:8:”WP_Error”:2:{s:6:”errors”;a:1:{s:30:”wpdb_get_table_charset_failure”;a:1:{i:0;s:0:””;}}s:10:”error_data”;a:0:{}}
They are coming in reserved names, banned emails, banned domains. Anyone got this problem? I can I solve it?
I’m using both wp and shardb latest
]]>I successfully installed shardb on a clean wp installation and is working perfect, now I have a question how can I add a vip after migration?
When creating a site the database is randomly selected?
]]>@dolphin and Ron
hey guys,
I’m looking for the exact same script.
Do you mind sharing your working code with me/us?
Many thanks.
]]>Since updating WordPress to 4.2.2 from 3.9.x I am seeing errors when trying to add or edit content in the home blog. I can’t add posts, or save site options.
The issue seems to be the introduction of the get_table_charset()
function in wp-includes/wp-db.php
When making a call to that function, the wrong db name is given – xxxx_global instead of xxxx_home, so the wp_options table can’t be found. This throws an error at line 2274, e.g.
WordPress database error Table 'wp_someblog_global.wp_options' doesn't exist for query SHOW FULL COLUMNS FROM
wp_optionsmade by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, wp_cron, spawn_cron, set_transient, update_option, SharDB->query
If I return ‘utf8’ from that function instead of the error all is OK. Is this an issue with SharDB or could it just be my particular setup? I have $enable_home_db = true;
in my SharDB settings, and all was working well before the update.
Thanks.
]]>Hi,
What I should write to shardb_dataset value? I use 16 databases, these names:
database_0
database_1
database_2
…
database_a
database_b
…
database_f
My config file has this:
$shardb_dataset = ‘abc123’;
But the SharDB does not use all of databases.
Thanks,
Feriman
Hi!
For me the main thing of using SharDB plugin is to separate the wordpress multisite to different databases for each site. I dont really shore that SharDB plugin can do that, but I hope so :).
I have followed the installation guide, but I get this error when trying to Migrate Sites:
Can’t select database
We were able to connect to the database server (which means your username and password is okay) but not able to select the wp_home database.
Are you sure it exists?
Does the user root have permission to use the wp_home database?
On some systems the name of your database is prefixed with your username, so it would be like username_wp_home. Could that be the problem?
If you don’t know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.
Im google the error but I can nnot find any result on that question…
Does somebody have a tip on how to solve the error problem, thanks…
I use whis plugin (1 for home +16 DB for blogs) and I try add VIP DB for one blog. When I add to db-settings.php
add_vip_blog( 357, 'expert' ); //numer blog ID = 357 and DB name = expert
I receive many errors.
DB “expert” has the same DB user like others DB’s.
I tried also move tables of blog id 357 to DB “expert” and there are many errors also.
What am I doing wrong?
]]>Hello Ron,
I followed all the instructions of the guide and yet I have not SharDB Migration that not visible Back Office for Migration .
What I did wrong ?