Title: Error establishing a database connection &#8211; Mac/Apache
Last modified: August 19, 2016

---

# Error establishing a database connection – Mac/Apache

 *  [arungupta](https://wordpress.org/support/users/arungupta/)
 * (@arungupta)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-macapache/)
 * I’m trying to setup WordPress on my MacBook Pro using Apache 2.2, PHP 5.x and
   WordPress 2.8.4.
 * Unzipped the wordpress install in /Library/WebServer/Documents, and edited wp-
   config.php to:
 * — cut here —
    /** The name of the database for WordPress */ define(‘DB_NAME’,‘
   wordpress’);
 * /** MySQL database username */
    define(‘DB_USER’, ‘root’);
 * /** MySQL database password */
    define(‘DB_PASSWORD’, ”);
 * /** MySQL hostname */
    define(‘DB_HOST’, ‘localhost’); — cut here —
 * The database can be accessed correctly based upon the information specified in
   wp-config.php.
 * mysql -uroot -hlocalhost wordpress
 * I’ve seen the video at [http://educhalk.org/blog/?p=148](http://educhalk.org/blog/?p=148)
   and verified everything is correct.
 * However still getting the dreaded “Error establishing a database connection”.
 * Any suggestions ?
 * -Arun

The topic ‘Error establishing a database connection – Mac/Apache’ is closed to new
replies.

## Tags

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

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 0 replies
 * 1 participant
 * Last reply from: [arungupta](https://wordpress.org/support/users/arungupta/)
 * Last activity: [16 years, 10 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-macapache/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
