Title: Can&#8217;t establish database
Last modified: September 29, 2016

---

# Can’t establish database

 *  [ourflowspace](https://wordpress.org/support/users/ourflowspace/)
 * (@ourflowspace)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/cant-establish-database/)
 * I just added two sub-domains to an existing domain I have. In trying to set up
   a database after installing WordPress, I have tried several different combinations
   on the setup page. From leaving everything on the list as it is to changing everything,
   and many options in between, all I get at the end is the following: 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.
 * I don’t remember having this problem with my original website, but was set up
   a few years ago.

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

 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/cant-establish-database/#post-8236808)
 * – “Error establishing a database connection” means that there is a problem with
   the connection to your database
    – a problem with the credentials stored in the
   wp-config.php file not matching what mysql expects. – Try reviewing the following
   codex for some guidance: [http://codex.wordpress.org/Common_WordPress_Errors#Error_Establishing_Database_Connection](http://codex.wordpress.org/Common_WordPress_Errors#Error_Establishing_Database_Connection)
    -  This reply was modified 9 years, 9 months ago by [t-p](https://wordpress.org/support/users/t-p/).
 *  [kmessinger](https://wordpress.org/support/users/kmessinger/)
 * (@kmessinger)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/cant-establish-database/#post-8236812)
 * Look at the wp-config.php file for the one that is working. It should be pretty
   much the same except for the database name and the password.
    -  Database Name Database Name used by WordPress
       Database Username Username
      used to access Database Database Password Password used by Username to access
      Database Database Host The hostname of your Database Server. A port number,
      Unix socket file path or pipe may be needed as well

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

The topic ‘Can’t establish database’ is closed to new replies.

## Tags

 * [database connection](https://wordpress.org/support/topic-tag/database-connection/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [kmessinger](https://wordpress.org/support/users/kmessinger/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/cant-establish-database/#post-8236812)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
