Title: Error Establishing Database Connection
Last modified: September 1, 2016

---

# Error Establishing Database Connection

 *  [benjisea](https://wordpress.org/support/users/benjisea/)
 * (@benjisea)
 * [10 years ago](https://wordpress.org/support/topic/error-establishing-database-connection-104/)
 * Hey all, I’ve been stuck on this for a LONG time. So I installed MAMP locally
   on my computer, and I downloaded the WP zip so I can install WordPress on this
   server. I followed this guide: [https://www.smashingmagazine.com/2011/09/developing-wordpress-locally-with-mamp/](https://www.smashingmagazine.com/2011/09/developing-wordpress-locally-with-mamp/)
 * I checked the database’s name, password, and user.
 * define(‘DB_NAME’, ‘wordpress’);
 * /** MySQL database username */
    define(‘DB_USER’, ‘root’);
 * /** MySQL database password */
    define(‘DB_PASSWORD’, ‘root’);
 * The folder name I extracted from the WordPress.zip file, I renamed the folder
   to wordpress. I extracted that into the htdocs folder provided by MAMP. I typed
   [http://localhost:8888/wordpress/](http://localhost:8888/wordpress/) and it shows
   nothing but “Error establishing database connection” what do I do?
 * I tried every troubleshooting technique and I feel like I’m wasting more time
   getting this set up than actually developing themes.
 * Ben

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

 *  [mosabua](https://wordpress.org/support/users/mosabua/)
 * (@mosabua)
 * [10 years ago](https://wordpress.org/support/topic/error-establishing-database-connection-104/#post-7523173)
 * Did you create the database “wordpress” with phpmyadmin?
 * If you want to try wordpress local then you can also try DesktopServer – a WordPress-
   specific XAMP version ([https://serverpress.com/get-desktopserver/](https://serverpress.com/get-desktopserver/)).
 *  [Dion](https://wordpress.org/support/users/diondesigns/)
 * (@diondesigns)
 * [10 years ago](https://wordpress.org/support/topic/error-establishing-database-connection-104/#post-7523241)
 * You also need to set the DB_HOST constant in wp-config.php to the database hostname
   set up by MAMP.
 *  [Learn WP Basics](https://wordpress.org/support/users/learnwpbasics/)
 * (@learnwpbasics)
 * [10 years ago](https://wordpress.org/support/topic/error-establishing-database-connection-104/#post-7523264)
 * – From the MAMP Start Page, select phpMyAdmin from the Tools menu.
    – Click the
   Databases tab and enter wordpress as the database name then click Create – As
   DionDesign mentions, you need to add localhost as your DB Host.
 * The info you need to enter on the Database Connection page of the WP Install 
   is then:
 * Database Name: wordpress
    User Name: root Password: root Database Host: localhost
   Table Prefix: wp_ <<leave as-is>>
 * Submit … away you go 🙂
 *  [Yogesh Londhe](https://wordpress.org/support/users/yoga1103/)
 * (@yoga1103)
 * [10 years ago](https://wordpress.org/support/topic/error-establishing-database-connection-104/#post-7523326)
 * Hi Ben,
 * This guide will definitely help you: [https://codex.wordpress.org/Installing_WordPress_Locally_on_Your_Mac_With_MAMP](https://codex.wordpress.org/Installing_WordPress_Locally_on_Your_Mac_With_MAMP)
 *  Thread Starter [benjisea](https://wordpress.org/support/users/benjisea/)
 * (@benjisea)
 * [10 years ago](https://wordpress.org/support/topic/error-establishing-database-connection-104/#post-7523409)
 * Hello Dion and yoga1103, yes I am installing WordPress on my local server in 
   my computer. I have everything ay ok and running. Here are screenshots to see
   if I’ve done everything right. I got the wordpress database already created in
   PhpMyAdmin, I got the wordpress.zip file extracted in the htdocs folder for MAMP,
   I changed the wp-config.php file accordingly. I don’t know what I’m doing wrong.
 * > [View post on imgur.com](https://imgur.com/a/x2KYL)
 * Thanks.

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

The topic ‘Error Establishing Database Connection’ is closed to new replies.

## Tags

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

 * In: [Localhost Installs](https://wordpress.org/support/forum/localhost-installs/)
 * 5 replies
 * 5 participants
 * Last reply from: [benjisea](https://wordpress.org/support/users/benjisea/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/error-establishing-database-connection-104/#post-7523409)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
