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

---

# Error Msg: Error establishing a database connection

 *  [jorchav](https://wordpress.org/support/users/jorchav/)
 * (@jorchav)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/error-msg-error-establishing-a-database-connection/)
 * Got this error 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?” For the three questions, the answers are: Yes, What is “Hostname”?
   and No.
 * I installed v2.6 using Fantastico. It was working fine when I left it last night.
 * Suggestions, Anyone?
 * Thanks!
 * Jorge Chavez (jorchav)

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

 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/error-msg-error-establishing-a-database-connection/#post-834458)
 * How come the answer is YES when you dodn’t even know what the question is…
 * hostname = DB_HOST in your config file.
 * And if this is a fantastico instllation AND you didn’t touch anything… what did**
   your hos**t answer when you asked them?
 *  Thread Starter [jorchav](https://wordpress.org/support/users/jorchav/)
 * (@jorchav)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/error-msg-error-establishing-a-database-connection/#post-834589)
 * The answer to the first question is Yes because the correct username and password
   were used.
 * Re Question 2. Here is a print-out of the wp-config.php file:
 * >  `<?php // ** MySQL settings ** // define('DB_NAME', 'netin123_wrdp1'); // 
   > The name of the database define('DB_USER', 'netin123_wrdp1'); // Your MySQL
   > username define('DB_PASSWORD', '***********'); // ...and password define('DB_HOST','
   > localhost'); // 99% chance you won't need to change this value define('DB_CHARSET','
   > utf8'); define('DB_COLLATE', ''); // Change each KEY to a different unique 
   > phrase. You won't have to remember the phrases later, // so make them long 
   > and complicated. You can visit http://api.wordpress.org/secret-key/1.1/ // 
   > to get keys generated for you, or just make something up. Each key should have
   > a different phrase. define('AUTH_KEY', 'f7sXx[2wbB@LBwlxS{A56y>+DiP[2ct773mmXz
   > iq\\Ms}?(;_a#ypoR5\'3w<G5>FL~1X'); // Change this to a unique phrase. define('
   > SECURE_AUTH_KEY', '-\"r642fed3E1d>}MdGFlh@tR!QPU%/!S_6;CjO0}^>6TDiP[2ct773mm
   > + <?)3 U#*X;'); // Change this to a unique phrase. define('LOGGED_IN_KEY', '
   > Q^l\"6-pLDiP[2ct773mm\zkw>OG<U$%u0:9H:Jl)+d$~jIBTt&CPL[Dp<KY4zL3y'); // Change
   > this to a unique phrase. // You can have multiple installations in one database
   > if you give each a unique prefix $table_prefix = 'wp_'; // Only numbers, letters,
   > and underscores please! // Change this to localize WordPress. A corresponding
   > MO file for the // chosen language must be installed to wp-content/languages.//
   > For example, install de.mo to wp-content/languages and set WPLANG to 'de' //
   > to enable German language support. define ('WPLANG', ''); /* That's all, stop
   > editing! Happy blogging. */ if ( !defined('ABSPATH') ) define('ABSPATH', dirname(
   > __FILE__) . '/'); require_once(ABSPATH . 'wp-settings.php'); ?>`
 * Sorry, I am not familiar enough with PHP or what it’s trying to do here to read
   and understand the file contents. But hostname = DB_HOST seems to be there, right?
 * Re: Is the database server running? The webhost has not yet responded to my support
   ticket question on that. However I have 7 websites up and operating on that server
   as well as an autoresponder and an ad tracker. All seem to be O.K. Doesn’t that
   tell me that the database server must be running, for those websites and server-
   side scripts to load and work O.K.?
 * Any suggestions as to where to go from here would be greatly appreciated!
 * Thanks!
 * Jorge

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

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

## Tags

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

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 2 replies
 * 2 participants
 * Last reply from: [jorchav](https://wordpress.org/support/users/jorchav/)
 * Last activity: [17 years, 10 months ago](https://wordpress.org/support/topic/error-msg-error-establishing-a-database-connection/#post-834589)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
