• 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

    (@t-p)

    – “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.ww.wp.xz.cn/Common_WordPress_Errors#Error_Establishing_Database_Connection

    • This reply was modified 9 years, 8 months ago by t-p.

    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.