• We have a local test server on our network, with a number of WordPress blogs on it. Some work and some don’t; I can’t figure out why.

    Some give the error, “Error establishing database connection” and others work completely fine. Others give a “white screen of death” on some pages and work fine on others.

    These errors aren’t because of a bad database connection, as this script reports it working fine:
    https://gist.github.com/162913.txt

    Doubtless I’ve done something wrong, but I don’t know how to debug it, since WP_DEBUG and the usual PHP error reporting methods don’t return anything helpful.

    Do you have any ideas?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Lee

    (@diondeville)

    Repair and optimize the affected databases. I use PhpMyAdmin to do this, I don’t know what you might use.

    Thread Starter Nabha Cosley

    (@nabha)

    That is an excellent idea, one I’ll remember for other times, but I wasn’t able to fix it that way.

    I tried optimizing, repairing, and finally, copying the entire database from the live site. (The live site does work.)

    Edit: I used Navicat MySQL, which I highly recommend as a database front end if you can connect to your MySQL server remotely.

    I’m having the exact same message. When I went to upgrade to 3.0, it died in the middle and then my site started giving this same error “Error establishing database connection.”

    I had just backed up my database before this happened. All I did was “export” it and save it to my desktop, so I don’t see how that could have ruined anything – that is what the directions here said to do.

    I’m very confused…I don’t know how to “optimize” – “repair” and all that, and I can’t copy anything from my live site because I can’t get to my site at all – just that error shows.

    Please tell me someone knows what to do. ??

    Are you sure its not a transient problem on the server? Would open a support ticket with your hosting company just in case.

    N.: You should be able to export (from PHPMyAdmin) or backup the file. If you are on a hosting company’s server check your cPanel or Plesk. Contact their support to find these.

    Thanks webjunk. I finally got hold of the girl that build my layout and she had me go in the wp-config.php file, and that’s when I realized that when I changed my MySQL password on godaddy, it apparently didn’t get changed in the actual files. As soon as I did that, it seemed to start working again, and I got to do the automatic upgrade. Hopefully it’s all better now.

    Thread Starter Nabha Cosley

    (@nabha)

    For anyone interested:

    I ended up fixing this on most of the copies of WordPress. It had to do with URL rewriting in at least one case — with the database actually not being there in another (sad, I know!) — but in a third, I have yet to figure it out.

    The database is there and the settings are correct, but all WordPress pages return the error.

    Thread Starter Nabha Cosley

    (@nabha)

    Hooray! Here’s what fixed this error for me:

    We had WordPress 3.0 installed and Multisite enabled.

    1. I was using an old wp-config.php setting, define( ‘VHOST’, false );, and that had to be changed to define( ‘SUBDOMAIN_INSTALL’, false );

    2. Because it was on a test server, our dev site address had to be used (instead of our LIVE site address) in two places in the wp_options table and also in the (new) wp_blogs table.

    That means our test database has to be slightly different from our live database.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘“Error establishing database connection” — but it lies!!’ is closed to new replies.