报错信息
Warning: mysqli::mysqli(): The server requested authentication method unknown to the client [caching_sha2_password] in mysqli.php
解决办法
1)将php的版本更新为PHP7.2
发现当使用的版本是PHP7.3 或 PHP5.6时会出现这个警告。
2)解决办法第二种,修改mysql的配置
打开 /usr/local/etc/my.cnf 加入如下一段:
default-authentication-plugin=mysql_native_password
保存,brew services restart mysql 重启
博客围绕PHP报错展开,指出使用PHP7.3或PHP5.6时会出现警告。给出两种解决办法,一是将PHP版本更新为PHP7.2,二是修改mysql的配置,加入特定内容后保存并重启。
5178

被折叠的 条评论
为什么被折叠?



