一路探索者

导航

 

PHP调用通过mysqli调用MySQL 数据库之前,必须配置MySQL 数据库的my.ini文件。对于MySQL 8数据库,除了同其它数据类似的常规安装外,则可能还需要my.cnf文件中启用mysql_native_password,具体操作参考如下:

default_authentication_plugin=mysql_native_password

因为MySQL 8 默认使用 caching_sha2_password,若你未使用 caching_sha2_password 时,也会看到类似这样的错误:

The server requested authentication method unknown to the client [caching_sha2_password]。

posted on 2025-03-25 09:50  一路探索者  阅读(21)  评论(0)    收藏  举报