Support » Localhost Installs » Error establishing a database connection

  • I am not able to retrieve a WordPress site, located on my macbook, in the browser. I get an error reading:

    “The server requested authentication method unknown to the client”

    “Error establishing a database connection”

    When I do

    $ brew info mysql

    I get the output below, which reads there is a conflict with mariadb. However, if I do

    $ brew list

    mariadb is not in the list.

    I’m able to connect to mysql via the terminal.

    I created a database.

    I’d appreciate your help please.

    mysql: stable 8.0.18 (bottled)
    Open source relational database management system
    Conflicts with:
    mariadb (because mysql, mariadb, and percona install the same binaries.)
    percona-server (because mysql, mariadb, and percona install the same binaries.)
    /usr/local/Cellar/mysql/8.0.18_1 (287 files, 278.2MB) *
    Poured from bottle on 2020-01-14 at 13:28:05
    ==> Dependencies
    Build: cmake ✘
    Required: openssl@1.1 :heavy_check_mark:, protobuf@3.7 :heavy_check_mark:
    ==> Requirements
    Required: macOS >= 10.10 :heavy_check_mark:
    ==> Caveats
    We’ve installed your MySQL database without a root password. To secure it run:

    MySQL is configured to only allow connections from localhost by default

    To connect run:
    mysql -uroot

    To have launchd start mysql now and restart at login:
    brew services start mysql
    Or, if you don’t want/need a background service you can just run:
    mysql.server start
    ==> Analytics
    install: 61,349 (30 days), 210,631 (90 days), 835,439 (365 days)
    install-on-request: 58,760 (30 days), 199,987 (90 days), 781,235 (365 days)
    build-error: 0 (30 days)

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @mcamil,

    Sorry for the issue you’re experiencing.

    The “Error establishing a database connection” message always comes up when WordPress can’t connect to your database.

    Double-check that your database credentials (username, password, table prefix) in the wp-config file are correct.

    WordPress can’t connect to your database hence the error.

    Thank you, Sunday. The database credentials are correct.

    You’re welcome.

    I saw a solution to a similar issue on stackoverflow, you should check it out.

    Keep me posted.

    @sukafia – I tried the solutions of stackoverflow, but still can’t establish connection on

    I can only access the database if I do

    $ brew services start mysql;
    $ use databasename;

    @sukafia – if i do

    $ sudo mysql.server start

    I get:
    . ERROR! The server quit without updating PID file (/usr/local/var/mysql/

    I don’t have a pid file on that location.

    You didn’t mention how you’re running WordPress on your MacBook. With MAMB, Local by flywheel, XAMPP?

    I know Mac has an Apache web server built in, but running WordPress with the above tools is much easier.

    You can setup a new installation and manually migrate your contents from the old installation over.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.