Search code examples
mysqldrupal-7php-7macos-sierra

Drupal not connect to database in macOS Sierra?


Mysql is run in brew services

brew services list

But not connect in installing steps and show blow error!

Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client.

Is the database server running? Does the database exist, and have you entered the correct database name? Have you entered the correct username and password? Have you entered the correct database hostname?


Solution

  • That error is usually caused by the version of MySQL you are running, older versions have a 16 character long password hash, but new(ish) versions of PHP will send a larger hash which will trigger that error.

    Or, you could have new version of MySQL but my.cnf has 'old-passwords = 1'

    If the latter isn't the case then upgrade to MySQL 5.x