Support » Networking WordPress » Misleading "Error establishing a database connection"

  • Today I migrated my multisite wordpress install from staging domain to the public www domain, I replaced the domain entries everywhere except for the “wp_blogs” table (this is the first time I do such thing, so it’s my bad), the problem I found is, even if my database information was correct in wp-config.php, I got the the:

    “Error establishing a database connection”

    This made me try to solve the issue fixing the mysql connection of course, after an hour of hustle and really not understading why wordpress can’t connect to my database even if I could connect fine trough the shell, I tried to login into the /wp-admin where I finally got a meaningful error message: the domain wasn’t listed in the wp_blogs table, after I fixed that everything was fine.

    I’m posting this in part to report it as a bug and also to save some other lost soul the trouble, in either case, it would make a lot more sense if in the frontend you can get the same meaningful error message instead of the totally misleading error establishing a database connection.. afterall wordpress was able to connect to the database, just didn’t found the right entry in wp_blogs.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Andrea Rennick


    Customer Care at Copyblogger Media and Studiopress

    I’m posting this in part to report it as a bug

    posting bugs in the forum means the devs never see it.

    Bug reporting is here:

    Expect it to get punted to 3.2, as 3.1 is at RC 5 and we’re all just trying to get it out the door already.

    You’re right.

    Here is the ticket for reference:

    I found out it is causing problem because new wordpress 3.1 try to connect to wp_ set of table instead of wp_1_ for the first blog as in WPMU. So the only solution at the moment is to rename those blog 1 tables to wp_ prefix. That’s how I made and the rests work.

    I hope there will be plugins to do this because i’m having near to hundred of blogs and maintaining those tables are very time consuming.

    Please let me know when a better solution is found. Thanks.

    Moderator Ipstenu (Mika Epstein)


    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    Your first blog SHOULD be wp_ (not wp_1 ).

    The only time your blog would be wp_1 is if you were on WPMU (remember to call it MultiSite now) and even THEN it should have been already working…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Misleading "Error establishing a database connection"’ is closed to new replies.