"can't select the database"

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!

Bryan

  • bc2116

    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

  • bc2116

    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 https://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

  • bc2116

    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

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.