when php7.3
, laravel5.7
, mysql8.0
is installed on centos7.5, the following error occurs when running php artisan migrate
:
Illuminate\Database\QueryException : SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: select * from information_schema.tables where table_schema = blog and table_name = migrations)
solution to Baidu:
Delete the created user and authorization, change it to the original authentication method, and then create the new user and authorize:find the mysql profile and add:
default_authentication_plugin=mysql_native_password
or
mysql-uroot-p
use mysql;
ALTER USER "root"@"localhost" IDENTIFIED WITH mysql_native_password BY" your password";
problem:
Baidu"s solution is to go back to the previous verification method. What should I do if I want to use the new verification method?