• RobotHero

    (@robothero)


    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:
    https://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

    (@esmi)

    Does your db user have full permissions?

    Thread Starter RobotHero

    (@robothero)

    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

    (@robothero)

    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

    (@robothero)

    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, https://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

    (@robothero)

    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.