Title: Error establishing a database connection
Last modified: August 19, 2016

---

# Error establishing a database connection

 *  [scnix](https://wordpress.org/support/users/scnix/)
 * (@scnix)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-146/)
 * Hi I’m really new with wordpress and I keep getting this 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 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’ve followed all the steps, created the DB according to my wp_config but no 
   go. I’ve read that you need to place all WP files in the root folder but I didn’t
   quite like that idea. Simply because I have a couple of other folders that I 
   place on my site to run different webpages and it would look very messy. I also
   don’t want WP to be my “main” site. At the moment, the WP folder in under root(/
   root/wordpress/wp-admin/).
 * Must wordpress be in the root to install? If so, can I move the wp files after
   installation into another folder?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-146/#post-1188397)
 * > Must wordpress be in the root to install?
 * No.
 * It sounds like you have a problem with the username, password, db name or db 
   host values that you added to wp-config.php
 *  [figaro](https://wordpress.org/support/users/figaro/)
 * (@figaro)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-146/#post-1188407)
 * See the following video to troubleshoot that error.
    [link moderated]
 *  [new-ren](https://wordpress.org/support/users/new-ren/)
 * (@new-ren)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-146/#post-1188429)
 * >  [http://groups.google.com/group/kicksonfire/web/kicksonfire?hl=en](http://groups.google.com/group/kicksonfire/web/kicksonfire?hl=en)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Error establishing a database connection’ is closed to new replies.

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 3 replies
 * 4 participants
 * Last reply from: [new-ren](https://wordpress.org/support/users/new-ren/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-146/#post-1188429)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
