• Hey everybody, since yesterday I’ve been having the ‘Error establishing a database connection’ problem. I’ve looked it up online and mostly advice says to modify we wp-config.php file, and I’ve done so, by cheching the credentials (which were fine because I never modified them before) and to add the define( ‘WP_ALLOW_REPAIR’, true ); line at the end, which did nothing.
    When I enter http://localhost/phpmyadmin/index.php URL I get the following errors

    mysqli_real_connect(): (HY000/1130): Host ‘localhost’ is not allowed to connect to this MariaDB server

    The connection for controluser, as defined in config, failed

    phpMyAdmin tried connecting to the MySQL server and the server rejected the connection. You should revise the host, the username and password in config.inc.php and make sure they match the info provided by the admin of the MySQL server.

    So I’m wondering if theres any other ways to fix it and if you know why I’m having said problem, as I’ve never touched my DB info nor am I currently using it, as I’m just starting to make the page (I’m still at the localhost environment)
    Thanks for your help, I really need, if you need any more info, let me know!

    • This topic was modified 6 years, 8 months ago by James Huff. Reason: Cleaned up formatting and moved to Localhosts
Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    >> mysqli_real_connect(): (HY000/1130): Host ‘localhost’ is not allowed to connect to this MariaDB server <<

    This indicates that the problem is in your MariaDB configuration and not in WordPress. Check the configs for MariaDB. How are you hosting this site?

    Thread Starter pompom248

    (@pompom248)

    Hey Steve, I’m not sure if this answers your question but I’m using localhost, I’m no using a server and where could I find the file to configure my MariaDB? Thanks, for your help

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    HOW are you running a site on “localhost” XAMPP, WAMP, MAMP, native web server, etc? IN any case, this is outside of the scope of WP support.

    Thread Starter pompom248

    (@pompom248)

    I’m using XAMPP but I’m not using mariadb, I’m using MySQL, so that doesn’t make much sense, does it?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    The error says you’re using Maria. Contact XAMPP support for help with this.

    https://sourceforge.net/projects/xampp/support

    Thread Starter pompom248

    (@pompom248)

    Thanks, I’ll try that out

    Dion

    (@diondesigns)

    Use 127.0.0.1 for the host instead of localhost. Using localhost in MySQL/MariaDB implies a socket connection, which requires a special configuration in Windows that (to my knowledge) isn’t done by any Windows localhost product.

    Thread Starter pompom248

    (@pompom248)

    Hi Dion, I tried that and I get the same error. Thanks for your answer

    Dion

    (@diondesigns)

    If you can’t connect to MySQL/MariaDB with 127.0.0.1 as the host, then something is seriously wrong with XAMPP. The error would mean that you have no database users with permission to connect to either localhost or 127.0.0.1. You either deleted the MySQL root user, or it was never created.

    It’s definitely time to contact XAMPP support. Here’s the URL of their support board:

    https://community.apachefriends.org/f/

    this should be something wrong with database please check your database connection

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

The topic ‘Error establishing a database connection’ is closed to new replies.