Support » Installing WordPress » Error establishing a database connection

  • I am working on a school assignment that involves WordPress. I am trying to manually install it on my site on a subdomain, but I get this message when attempting to go to and (please excuse the long URLs):

    “Error establishing a database connection”

    I have “localhost” where it should be in the configuration file (and I’m 100% sure my database name, user and password are correct):

    /** MySQL hostname */
    define(‘DB_HOST’, ‘localhost’);

    I use — should I use something else?

Viewing 8 replies - 1 through 8 (of 8 total)
  • ‘localhost’ should be correct. Have you tried using the Bluehost automatic install option instead? They have an auto-installer in their cpanel which takes a few of the steps out of it.

    does your table-prefix match?

    If you go through cPanel, then to phpMyAdmin you can see all the WordPress tables… often prefixed with wp_

    so if your wp-config.php declares the prefix as mydb_ instead of wp_ that could cause problems.

    I have a problem in installation error in local machine:
    Error establishing a database connection

    Thanks! I assumed I had to do it all manually but after further inspection, my prof is ok w/ doing the auto-installer — that seemed to fix everything! Thanks for the feedback lettergrade & ajmcfayden!

    Awesome, glad everything is moving for you!

    Now what… Frank



    Forum Moderator

    @formulas: It is impolite to interrupt another poster’s ongoing thread with a question of your own. It causes significant problems for the forum’s volunteers and prevents us from being able to track issues by topic. Please post your own topic.

    This might be a bit late but BlueHost’s database name is usually prefixed by your account name e.g. pcfpress_wor1 which you need to specify in the config.php file.

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