Title: Error establishing a database connection &#8212; I&#8217;M LOST.
Last modified: August 19, 2016

---

# Error establishing a database connection — I’M LOST.

 *  [fieryairah](https://wordpress.org/support/users/fieryairah/)
 * (@fieryairah)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-82/)
 * I really don’t understand the 5-minute install thing. I’ve been trying to install
   WordPress on my site the whole night and yet I still couldn’t establish a database
   connection? I wonder what’s wrong.
 * Can anybody please help?
 * I read other forum stuff about this one and I really wonder what’s wrong. Am 
   I missing something basic here? I’m not really good at this kind of codes. Please
   please help.. Thanks.
 * …………
    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? …………
 * THIS IS MY wp-config.php:
 * ——————————————————-
 * <?php
    // ** MySQL settings ** // define(‘DB_NAME’, ‘wordpressblog’); // The 
   name of the database define(‘DB_USER’, ‘xxxxxxxxxxxxx’); // Your MySQL username
   define(‘DB_PASSWORD’, ‘xxxxxxxxx’); // …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/](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’, ‘put your unique phrase here’); // Change
   this to a unique phrase. define(‘SECURE_AUTH_KEY’, ‘put your unique phrase here’);//
   Change this to a unique phrase. define(‘LOGGED_IN_KEY’, ‘put your unique phrase
   here’); // 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’); ?>
 * ——————————————————-
 * Please help. Thanks!
 * Airah

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

 *  [vietknight](https://wordpress.org/support/users/vietknight/)
 * (@vietknight)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-82/#post-879991)
 * Have you created a database yet?
    Are your database credentials correct, aka 
   dbname/username/password? Do the following credentials appear exactly the same
   in your wp-config.php? Is your host’s database up and running?
 * Looks like you also need to fill in your Secret key values.
 * Visit this link:
 * [http://api.wordpress.org/secret-key/1.1/](http://api.wordpress.org/secret-key/1.1/)
 * and copy/paste the randomly generated values into wp-config, as stated in your
   wp-config file.
 *  Thread Starter [fieryairah](https://wordpress.org/support/users/fieryairah/)
 * (@fieryairah)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-82/#post-879995)
 * >  Have you created a database yet?
   >  Are your database credentials correct, aka
   > dbname/username/password? Do the following credentials appear exactly the same
   > in your wp-config.php? Is your host’s database up and running?
   > Looks like you also need to fill in your Secret key values.
   > Visit this link:
   > [http://api.wordpress.org/secret-key/1.1/](http://api.wordpress.org/secret-key/1.1/)
   > and copy/paste the randomly generated values into wp-config, as stated in your
   > wp-config file.
 * I’ve checked, and the answer is yes. I even copied the secret key values from
   a generator.
 * HERE IS MY wp-config file now:
 * ————————————————————-
    <?php // ** MySQL settings ** // define(‘DB_NAME’, ‘wordpressblog’);//
   The name of the database define(‘DB_USER’, ‘missmelodrama’); // Your MySQL username
   define(‘DB_PASSWORD’, ‘xxxxxxxxxx’); // …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/](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’, ‘g*;1&i-:^\’^O;_.`q<5^F3\\}jj#S!iISX$Q
   |!I%|\’7:HG!L]-8-\”SgO?,E[/\”N I’); define(‘SECURE_AUTH_KEY’, ‘ikktM^dmFIpki*
   B5YqW\\Bag@LEX?j*K6VsyM}8v`p6G\” #^[rT/qQfWS_uP/?5$E’); define(‘LOGGED_IN_KEY’,‘
   5.Mec9HuU[4=R Lu394`^q`_MRGIS;4&E?|O](b282z)yDOAL7c1R=[BqdLWaC9^’);
 * // 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’); ?> ————————————————————-
 * Still Database Error. [http://missmelodrama.com/](http://missmelodrama.com/)
 * Now, I’m really really lost. What’s wrong with the database? I can’t seem to 
   make it work.
 * Thanks for the help anyway. Any more suggestions?
 * Thanks.
 * Airah
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [17 years, 7 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-82/#post-879998)
 * > _Error establishing a database connection_
 * This error means one thing: That it could not connect to the database. So either
   the username/password/hostname are wrong, or the database is not running, or 
   the box cannot talk to the database because of some network related reason.
 * That’s it. That’s the only possible problems. So figure out which one it is. 
   We can’t much help you with that beyond telling you this, because we don’t have
   access to your setup.
 *  [thisisedie](https://wordpress.org/support/users/thisisedie/)
 * (@thisisedie)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-82/#post-880001)
 * I find that a lot of people simply ignore the hostname because it says it’s 99%
   likely to be localhost but in many cases, it is not. Are you **sure** you can
   use localhost?

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

The topic ‘Error establishing a database connection — I’M LOST.’ is closed to new
replies.

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

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
