当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]
为什么会这样?