报错信息
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
重启