Support » Fixing WordPress » Error establishing a database connection

  • Hi everyone,

    Desperately need some help!
    A few days ago I had the dreaded “Error establishing a database connection” that nobody seems to understand/fix. I could no longer even access my Blog to change anything. So I tried to change the wp_config.php with FTP to no avail. I asked my host. Nothing on his side!

    Finally I followed the WordPress documentation bible to properly reedit the file. Following the guide I inadvertently reinstalled a new sample Blog ๐Ÿ™ making the old one disappear. My stupidity seems to have no limitsรขโ‚ฌยฆ Bottom line, thank God I still have all my old Blog files in Mysql accessible with cpanel. In other words I have two copies of all the table files under slightly different names: categories, links, options, etc.
    Do I just delete the new ones, the ones created with the reinstall or is there a way to tell which tables to use in the wordpress admin. I could not find anything in options or anywhere else.
    Any help greatly appreciated.

Viewing 8 replies - 1 through 8 (of 8 total)
  • 1. Ther are no files in a MySQL database, but it’s OK. It’s just tables and data.
    2. You mean the two set of tables have the same prefix? Or do they have different prefixes, like: wp_options and blog_options. If they are different, you just have to select the “new” ones in phpMyadmin and drop them. Check 3 times before dropping – after that everything is gone forever!
    (Better make a backup before doing anything: )

    Thanks Moshu,

    That’s what I was going to do. Just a question:
    The new tables have a wp_ prefix and the old ones have been changed somehow into wpboriscategories etc. Should I rename them with the wp_ prefix after deleting the ones created by the reinstall?

    It doesn’t really matter what the prefix is. Probably the old config file didn’t have the _ (underscore) after the wp, which is your luck: otherwise the new install would have overwritten the old tables ๐Ÿ™‚

    Thanks a lot Mosghu. I did a backup. I still don’t understand why the wp_ has been changed in the old tables names. But as you say it was my luck ๐Ÿ™‚ Could someone have had access to my tables and modify something? That would explain why I got the “error establishing a database connection” in the first place as I personally had never changed anything when that error suddenly occured…

    In any events thanks again I will try the new tables’ drop and wish for the best ๐Ÿ™‚


    After dropping the wp_ tables I get this message when I try to access my blog:
    “It doesn’t look like you’ve installed WP yet. Try running install.php.”
    which I had before and prompted me to reinstall! Is there a way to get out of this loop?

    Any idea?

    Check your config file: is the prefix in it the same as in the DB?

    I’m not sure I understand the question. The name of the database is wellmast_wp1 in the wp_config.php file. In the phpMyAdmin the database shows as _wp1 (9) for 9 tables I guess, but the tables are called wpboriscategories, wpboriscomments, etc.

    Is that the issue? and if it is, how do I rename the tables?

    Well miracles still happen these days! I did change the names of the tables with phpMysql “Operations” to wp_categories, wp_comments, etc and it works! At least I get the blog as it was before the weird change.

    Thanks a lot for your help. Hope this thread can help someone else with the problem.

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