i have the same problem... cant figure it out
Unable to connect to DB from Laravel app or Sequel Pro
I have gone through the setup process for Laravel Valet following the docs. Everything works as expected until I try to connect an app to MySQL. After hours of trying I have been unable to connect to MySQL from a Laravel app or Sequel Pro. I can however connect from the command line with I have done to create the database.
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| app |
| clivecms |
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
6 rows in set (0.00 sec)
Using Homebrew I have confirmed all requirements are up to date and services are running.
$ brew services list
Name Status User Plist
dnsmasq started root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
mysql started jkc /Users/jkc/Library/LaunchAgents/homebrew.mxcl.mysql.plist
nginx started root /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
php started root /Library/LaunchDaemons/homebrew.mxcl.php.plist
After updating the .env file I run php artisan migrate and get the following error.
Illuminate\Database\QueryException : SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: select * from information_schema.tables where table_schema = app and table_name = migrations)
at /Users/jkc/Sites/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
660| // If an exception occurs when attempting to run a query, we'll format the error
661| // message to include the bindings with SQL, which will make this exception a
662| // lot more helpful to the developer instead of just the database's errors.
663| catch (Exception $e) {
> 664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
668|
Exception trace:
1 PDOException::("PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]")
/Users/jkc/Sites/app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68
2 PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=app", "root", "", [])
/Users/jkc/Sites/app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68
When I try and connect through Sequel Pro I get this error.
Unable to connect to host 127.0.0.1, or the request timed out.
Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds).
MySQL said: Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/lib/plugin/caching_sha2_password.so, 2): image not found
Any help in resolving this issue would be greatly appreciated.
Please or to participate in this conversation.