Title: drupal   Error establishing a database connection = what?
Last modified: August 19, 2016

---

# drupal Error establishing a database connection = what?

 *  [RobotHero](https://wordpress.org/support/users/robothero/)
 * (@robothero)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/drupal-error-establishing-a-database-connection-what/)
 * So I’m trying to install WordPress and I’m getting the classic “Error establishing
   a database connection” error.
 * I’ve followed along with this:
    [http://educhalk.org/blog/error-establishing-a-database-connection-how-to-fix-this-wordpress-error/](http://educhalk.org/blog/error-establishing-a-database-connection-how-to-fix-this-wordpress-error/)
 * Only thing that might be funny with it is I have a Drupal install already. But
   that also means I can see that Drupal runs without any database errors, I even
   tried running WordPress on the same database, just by converting this from the
   Drupal settings.php:
 * $db_url = ‘mysqli://BB:CC@localhost/AA’;
 * to its equivalent in wp-config.php:
 * define(‘DB_NAME’, ‘AA’);
    define(‘DB_USER’, ‘BB’); define(‘DB_PASSWORD’, ‘CC’);
   define(‘DB_HOST’, ‘localhost’);
 * I’ve double-checked that there’s no extra spaces before or after any of those.
   I can log in to phpMyadmin using the same user/password combo. I’ve tried it 
   both with the same database as I’m running Drupal from, and from a fresh database
   made for WordPress. The fresh database is completely empty, because it’s giving
   me this error instead of installing.
 * What am I missing?

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/drupal-error-establishing-a-database-connection-what/#post-1757478)
 * Does your db user have full permissions?
 *  Thread Starter [RobotHero](https://wordpress.org/support/users/robothero/)
 * (@robothero)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/drupal-error-establishing-a-database-connection-what/#post-1757501)
 * It says “Create, Alter SP, Execute SP, Update, Delete, Show View, Lock, Create
   View, Drop, Create SP, Select, Alter, Insert”
 * I think that’s all of them, plus I went to phpMyadmin and created and dropped
   a table.
 *  Thread Starter [RobotHero](https://wordpress.org/support/users/robothero/)
 * (@robothero)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/drupal-error-establishing-a-database-connection-what/#post-1757513)
 * I’ve now tried it on another site where I wasn’t concerned about losing the drupal
   install, and I cleared all that out, emptied the database, and got the same error.
 * It’s a different host, same problem.
 * I get the full error on
    wp-activate.php and wp-admin/install.php
 * Just the one line on index.php
 *  Thread Starter [RobotHero](https://wordpress.org/support/users/robothero/)
 * (@robothero)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/drupal-error-establishing-a-database-connection-what/#post-1757568)
 * Okay, I got it to work on the second site by changing ‘localhost’ to the actual
   domain name. But that didn’t work on the original site I had a problem with.
 * On the first one, I’ve tried thedomain.com, [http://www.thedomain.com](http://www.thedomain.com),
   the IP address, local, none has worked. And I would have expected ‘localhost’
   to work fine, because that’s what Drupal was using without any problem.
 *  Thread Starter [RobotHero](https://wordpress.org/support/users/robothero/)
 * (@robothero)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/drupal-error-establishing-a-database-connection-what/#post-1757573)
 * And I found a thing in my hosts stuff what says I had to use:
    localhost:/tmp/
   mysql5.sock
 * I don’t know why Drupal never needed that but WordPress did. But it works, now.

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

The topic ‘drupal Error establishing a database connection = what?’ is closed to
new replies.

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 5 replies
 * 2 participants
 * Last reply from: [RobotHero](https://wordpress.org/support/users/robothero/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/drupal-error-establishing-a-database-connection-what/#post-1757573)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
