3 pointsGetting my WPMU DEV WingsI'm new here
bc2116
Member
—
12th December 2011
Hi, I followed the instructions on the multi-DB plugin and thought all was well. Until the very end when I go to login into the wp-admin and receive this:
Warning: mysql_get_server_info() [function.mysql-get-server-info]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/bc2116/whatsays.me/wp-content/db.php on line 705
Warning: mysql_get_server_info() [function.mysql-get-server-info]: A link to the server could not be established in /home/bc2116/whatsays.me/wp-content/db.php on line 705
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 database.
Are you sure it exists?
Does the user whatsaysme11 have permission to use the database?
On some systems the name of your database is prefixed with your username, so it would be like username_. 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.
-------
I've double and triple (and then some) checked everything, and it seems to be not a terribly difficult problem, but I can't get it. Anyone seen it? Any ideas? Thanks!
Hi, I followed the instructions on the multi-DB plugin and thought all was well. Until the very end when I go to login into the wp-admin and receive this:
Warning: mysql_get_server_info() [function.mysql-get-server-info]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/bc2116/whatsays.me/wp-content/db.php on line 705
Warning: mysql_get_server_info() [function.mysql-get-server-info]: A link to the server could not be established in /home/bc2116/whatsays.me/wp-content/db.php on line 705
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 database.
Are you sure it exists?
Does the user whatsaysme11 have permission to use the database?
On some systems the name of your database is prefixed with your username, so it would be like username_. 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.
-------
I've double and triple (and then some) checked everything, and it seems to be not a terribly difficult problem, but I can't get it. Anyone seen it? Any ideas? Thanks!
We were able to connect to the database server (which means your username and password is okay) but not able to select the database.
What permissions have you given your user to the database? Did you flush the permissions on your database server after you granted the rights to the database user?
Thanks for the quick reply and from no less than the guru himself, I believe. The user has the full permissions that my host's managed web panel allows, which is labelled, "select, insert, update, delete, create, drop, index, alter".
I didn't flush anything on the database server. Should I?
When you create accounts with INSERT, it is necessary to use FLUSH PRIVILEGES to tell the server to reload the grant tables. Otherwise, the changes go unnoticed until you restart the server.
Hmm, okay, well since I know how to restart my dedicated server and I've never flushed my db server, I just reset the server. But I still get the same error. I'll read more about db flushing but if rebooting the server should be just as effective please let me know because that may not be my problem.
So I setup a complete new install from scratch (on a different domain), setup multisite and followed the plugin instructions just as before. For better or worse, I wound up in the exact same position as I describe earlier. At least I'm consistent! Also what happened in each install that I didn't report before was that when I executed the move-blogs.php script and clicked the link to do the "heavy lifting" and copy the dbs, I received this warning 16 times:
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/bc2116/somethinghardtoforget.com/wp-content/move-blogs.php on line 140
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/bc2116/somethinghardtoforget.com/wp-content/move-blogs.php on line 141
-----
The first time around I was hoping that this was a mere warning and not a critical error, but perhaps it has something to do with the problem? After this takes place the move-blogs.php reports exactly what we're looking for, with all green indicators for the existing db and tables in the new db. So maybe this warning isn't so important.
But here is the repeat of the original problem I reported but with the new domain:
Warning: mysql_get_server_info() [function.mysql-get-server-info]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/bc2116/somethinghardtoforget.com/wp-content/db.php on line 705
Warning: mysql_get_server_info() [function.mysql-get-server-info]: A link to the server could not be established in /home/bc2116/somethinghardtoforget.com/wp-content/db.php on line 705
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 somethinghardtoforget_co_global database.
Are you sure it exists?
Does the user somethinghardtof have permission to use the somethinghardtoforget_co_global database?
On some systems the name of your database is prefixed with your username, so it would be like username_somethinghardtoforget_co_global. 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.
I was rechecking everything for the 100th time and I looked at the syntax described in the comments in db-config.pdp versus the output provided by the DB Server tool at http://premium.wpmudev.org/db-tools/db_servers.php:
//
// 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,'64.90.59.222','', 'somethinghardtoforget_co_global', 'somethinghardtof', 'MW?dDHJe');
It looks like in the comments that the local host example.com comes first and then any remote host comes next like example.lan. However, the DB Server tool outputs the remote host (left blank) first as '' and then gives the local host. I decide to reverse those addresses and conform to the way I was reading the db-config comments rather than use the output of the DB Server tool.
After making this change I could again login into the admin dashboard of the site and everything appears to be normal except on every page there is the following error:
Warning: mysql_set_charset() expects parameter 2 to be resource, boolean given in /home/bc2116/somethinghardtoforget.com/wp-includes/wp-db.php on line 541
I'm not sure what that means, and I'm not really sure if I'm running off of the multi-db's (or must I be at this point?), or if I'm running off the original db. But that brings up another question, do I have to "activate" the plugin, or is it as it seems, active once the files are upload to the wp-content directory.
Thanks for any help, and please excuse this flurry of messages, it's not out of impatience, but just simply to document and convey what's going on in the hopes that you might again have time to look at it and offer your thoughts.
Last update for tonight (sorry), switching around the syntax of the db-config.php did not rescue the problems for the original domain at http://www.whatsays.me, so may not have nothing to do with it. Of course if I remove the db.php and db-config.php files I can log into the admin dashboard as usual, I just can't get the multi-db thing to work out.
With the second domain, http://www.somethinghardtoforget.com, I can access the admin dashboard and I still have the db.php and db-config.php in the wp-content directory, and I just have that error I mentioned about (...parameter 2... ...wp-db.php on line 541).
Apologies as this seems to have been overlooked. Is there still an issue here? If so, please reopen and let us know. I'll ask Barry to respond and want to make sure this get's sorted for ya.
Thanks so much for the eventual reply. It didn't work exactly like the documentation instructed, but after a lot more fiddling around I did some how manage to get it working!
I'm glad to hear you were able to get it working. I've looked at the instructions and agree they could use with an update. We'll take a look, but definitely glad you were able to get it sorted.
Responses (10)
Developer — 12th December 2011 #
What permissions have you given your user to the database? Did you flush the permissions on your database server after you granted the rights to the database user?
Member — 12th December 2011 #
Hi,
Thanks for the quick reply and from no less than the guru himself, I believe. The user has the full permissions that my host's managed web panel allows, which is labelled, "select, insert, update, delete, create, drop, index, alter".
I didn't flush anything on the database server. Should I?
Thanks,
Bryan
Developer — 12th December 2011 #
Usually when you add permissions to a mysql, you need to flush it so that it picks them up for use:
http://dev.mysql.com/doc/refman/5.5/en/adding-users.html
Member — 12th December 2011 #
Hmm, okay, well since I know how to restart my dedicated server and I've never flushed my db server, I just reset the server. But I still get the same error. I'll read more about db flushing but if rebooting the server should be just as effective please let me know because that may not be my problem.
Thanks,
Bryan
Member — 13th December 2011 #
Hi again,
So I setup a complete new install from scratch (on a different domain), setup multisite and followed the plugin instructions just as before. For better or worse, I wound up in the exact same position as I describe earlier. At least I'm consistent! Also what happened in each install that I didn't report before was that when I executed the move-blogs.php script and clicked the link to do the "heavy lifting" and copy the dbs, I received this warning 16 times:
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/bc2116/somethinghardtoforget.com/wp-content/move-blogs.php on line 140
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/bc2116/somethinghardtoforget.com/wp-content/move-blogs.php on line 141
-----
The first time around I was hoping that this was a mere warning and not a critical error, but perhaps it has something to do with the problem? After this takes place the move-blogs.php reports exactly what we're looking for, with all green indicators for the existing db and tables in the new db. So maybe this warning isn't so important.
But here is the repeat of the original problem I reported but with the new domain:
Warning: mysql_get_server_info() [function.mysql-get-server-info]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/bc2116/somethinghardtoforget.com/wp-content/db.php on line 705
Warning: mysql_get_server_info() [function.mysql-get-server-info]: A link to the server could not be established in /home/bc2116/somethinghardtoforget.com/wp-content/db.php on line 705
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 somethinghardtoforget_co_global database.
Are you sure it exists?
Does the user somethinghardtof have permission to use the somethinghardtoforget_co_global database?
On some systems the name of your database is prefixed with your username, so it would be like username_somethinghardtoforget_co_global. 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.
Thanks for any further thoughts.
Bryan
Member — 13th December 2011 #
FYI -
I was rechecking everything for the 100th time and I looked at the syntax described in the comments in db-config.pdp versus the output provided by the DB Server tool at http://premium.wpmudev.org/db-tools/db_servers.php:
//
// 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,'64.90.59.222','', 'somethinghardtoforget_co_global', 'somethinghardtof', 'MW?dDHJe');
add_db_server('0', 'dc1', 1, 1,'64.90.59.222','', 'somethinghardtoforget_co_0', 'somethinghardtof', 'MW?dDHJe');
--------------
It looks like in the comments that the local host example.com comes first and then any remote host comes next like example.lan. However, the DB Server tool outputs the remote host (left blank) first as '' and then gives the local host. I decide to reverse those addresses and conform to the way I was reading the db-config comments rather than use the output of the DB Server tool.
After making this change I could again login into the admin dashboard of the site and everything appears to be normal except on every page there is the following error:
Warning: mysql_set_charset() expects parameter 2 to be resource, boolean given in /home/bc2116/somethinghardtoforget.com/wp-includes/wp-db.php on line 541
I'm not sure what that means, and I'm not really sure if I'm running off of the multi-db's (or must I be at this point?), or if I'm running off the original db. But that brings up another question, do I have to "activate" the plugin, or is it as it seems, active once the files are upload to the wp-content directory.
Thanks for any help, and please excuse this flurry of messages, it's not out of impatience, but just simply to document and convey what's going on in the hopes that you might again have time to look at it and offer your thoughts.
Best,
Bryan
Member — 13th December 2011 #
Last update for tonight (sorry), switching around the syntax of the db-config.php did not rescue the problems for the original domain at http://www.whatsays.me, so may not have nothing to do with it. Of course if I remove the db.php and db-config.php files I can log into the admin dashboard as usual, I just can't get the multi-db thing to work out.
With the second domain, http://www.somethinghardtoforget.com, I can access the admin dashboard and I still have the db.php and db-config.php in the wp-content directory, and I just have that error I mentioned about (...parameter 2... ...wp-db.php on line 541).
Bryan
Sales & Support Lead — 18th January 2012 #
Hiya,
Apologies as this seems to have been overlooked. Is there still an issue here? If so, please reopen and let us know. I'll ask Barry to respond and want to make sure this get's sorted for ya.
Thanks!
Member — 18th January 2012 #
Hey,
Thanks so much for the eventual reply. It didn't work exactly like the documentation instructed, but after a lot more fiddling around I did some how manage to get it working!
Best,
Bryan
Sales & Support Lead — 19th January 2012 #
Hiya Bryan,
I'm glad to hear you were able to get it working. I've looked at the instructions and agree they could use with an update. We'll take a look, but definitely glad you were able to get it sorted.
Thanks!
Become a member