Support » Installing WordPress » Error establishing a database connection

  • Hi, I am new to wordpress and am in need of some help – PLEASE!

    I have installed and uploaded wordpress to my site (which i am doing for a friend). I followed the famous 5-minute install and now i am at part 6, the final stage i am getting this message:
    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 you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

    I know my user name and password are correct, but i am unsure of my host. I did not change this and i kept it at localhost – please can anyone help?

    ps please you simple plain english – Thank you!!! :oD

Viewing 4 replies - 1 through 4 (of 4 total)
  • If you are using cPanel to admin your site you should have a phpMyAdmin option. Go there and look at the top of the screen (breadcrumbs) and you should see the server name which is probably localhost.

    If the site is from a shared hosting provider please be sure to prefix your database and user names with the “accountname_”.

    Hi Sophie,

    Where are you hosting your website?

    Did you complete steps 3 and 4 on the 5-minute install?

    3. Rename the wp-config-sample.php file to wp-config.php.
    4. Open wp-config.php in a text editor and fill in your database details as explained in Editing wp-config.php to generate and use your secret key password.

    Thank you for the quick replies!

    The website is hosted at hardlink hosting (i had no say in this). I did complete all the steps, but when completing step 6 that is when i get the error message. i had tried changing to url and ip address, but all had the same message.

    I see now that i need to create the database in cpanel login – way over my head, but trying anyway. As my friend already has a site, will creating the database cause the current site to fail? I have uploaded the wordpress site to a subdirectory in hope that will not cause any issues either.

    Any pointers will be much appreciated!

    Creating another database will not cause the current site to fail.

    Not sure if you are planning on having both sites on the same hardlink hosting account but please note that you can only have one site per URL ( A couple of option to consider include:
    1. a sub-domain – (just does the redirect to the subdirectory)
    2. manually entering the subdirectory –

    The video at the end of this post shows (among other items) how to complete the database tasks in cPanel. WordPress 3.5 Install Post

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