SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
发生这种错误,是由于MySQL 8默认使用了新的密码验证插件:caching_sha2_password。
我们只需要在my.ini 里加上默认密码验证插件为,Linux为 /etc/my.cnf
default_authentication_plugin = mysql_native_password //添加此就可以解决