Support » Installing WordPress » Error establishing a database connection at /wp-admin/install.php

  • I’ve setup the DB in Cpanel, changed the wp-config-sample.php to wp-config.php and placed my Database name, username, used localhost as my DB hostname etc. into the wp-config.php then uploaded the files to my directory.

    Now I try go to /wp-admin/install.php and it shows the error:

    Error establishing a database connection
    This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.

    Are you sure you have the correct username and password?
    Are you sure that you have typed the correct hostname?
    Are you sure that the database server is running?

    If i go to /wp-admin/setup-config.php it shows this error:
    Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.

    Please Help! Thank-you.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You should double-check what you have as the values for your wp-config.php file as this is pretty much always the problem. it can be just one character our, or an extra space where it shouldn’t be, but that’s enough to stop it working. Another potential problem is that ‘localhost’ might not work on your server as the hostname, soif you’re sure that what you’ve got there is corrct you should contact your hosting company and get them to double-check what you’ve got as they’ll be able to see any problems.

    placed my Database name, username, used localhost as my DB hostname etc. into the wp-config.php then uploaded the files to my directory.

    Another potential issue when editing the file locally is if you did so on a Mac using Text Edit as by default, it uses curly quotes instead of plain old ones. That is, of course, if you edited the quotes. You shouldn’t need to, but sometimes one deletes it by mistake and then it gets replaced with the “wrong kind”. And, as catacaustic says, that’s enough to stop it working.

    I always use the file editor of the file manager of the hosting control panel; never an issue that way.

    The text editor part is right and does happen a lot, but it will give you a different error message. If it’s an issue with the quotes you’ll get a PHP error and not the “Error establishing database connection” message.

    Thread Starter nickd123

    (@nickd123)

    I’ve double-checked multiple times, still with no luck 🙁
    I even removed all the files and re uploaded the files and re-created the database twice and had the same error.

    I also tried to use Fantastico to install wordpress but got this error:
    Access denied for user ‘______’@’localhost’ (using password: NO)

    Thread Starter nickd123

    (@nickd123)

    I also looked into the database hostname and on uberglobal (hosting account) on their website and in the steps for installing wordpress it says:

    ” Start filling out the information for the database you created earlier. When you get to “Database Host” and “Table Prefix” it is fine to leave the default values as they are.”

    Did you contact your hosting companys support team? As I said before, if you think that you are right, then they are the only ones that can tell you if you are wrong or if there is a server problem. Please contact them to find out.

    Thread Starter nickd123

    (@nickd123)

    Okay I will, thanks.

    Thread Starter nickd123

    (@nickd123)

    Okay I will, thanks.

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