Laravel调度程序无法连接到MySQL

时间:2019-03-28 16:00:38

标签: mysql-8.0 laravel-5.8

当MySql上的用户设置为使用caching_sha2_password时,我的Laravel应用程序可以与mysql8完美配合,但是我的crontab调度程序在尝试连接数据库时仍然失败

当我将MySql用户更改为使用mysql_native_password时,调度程序可以工作,但是Laravel应用程序无法连接。

"exception":"[object] (Illuminate\\Database\\QueryException(code: 2054): SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
.../vendor/laravel/framework/src/Illuminate/Database/Connection.php:664, PDOException(code: 2054): SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client at .../vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70, PDOException(code: 0): PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password] at .../vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70)
[stacktrace]

为什么会这样?

0 个答案:

没有答案