WordPress.org

Ready to get started?Download WordPress

Forums

Misleading "Error establishing a database connection" (5 posts)

  1. roberto.carvajal
    Member
    Posted 3 years ago #

    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.

  2. 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:
    core.trac.wordpress.org

    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.

  3. roberto.carvajal
    Member
    Posted 3 years ago #

    You're right.

    Here is the ticket for reference:

    http://core.trac.wordpress.org/ticket/16609

  4. Binh
    Member
    Posted 3 years ago #

    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 meo.vn 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.

  5. 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...

Topic Closed

This topic has been closed to new replies.

About this Topic