我之前也开始研究AMH面板,感觉确实还不错。AMH的整体负载都要比BT好太多,这对我来说是一个很大的优势。但是,AMH的界面确实比BT差太多,如果用习惯了BT的话,上手还是有些困难。不过,我还是认为AMH是一个不错的选择,因为长时间用多摸索,慢慢的也就习惯了。

这几天继续在折腾AMH的过程中发现了我安装的mysql8在performance_schema数据库下的error_log表中有上万条的错误信息,都是在提示,"Plugin mysql_native_password reported: ''mysql_native_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'"。

这个问题查了下原因大概是因为Mysql8的登陆验证方式改为了caching_sha2_password instead,mysql_native_password是老版本的验证方式,所以导致mysql8不停的在进行报错。

大概的问题也可以登陆mysql进行验证,并解决这个问题。

登陆mysql,并查询用户表

use mysql;

SELECT Host, User, plugin from user;
HostUserplugin
localhostmysql.infoschemacaching_sha2_password
localhostmysql.sessioncaching_sha2_password
localhostmysql.syscaching_sha2_password
localhostrootmysql_native_password

可以看到root账户还是mysql_native_password,那么就把它修改成caching_sha2_password。

ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourpassword';

刷新权限

FLUSH PRIVILEGES;

再次查看用户表

SELECT Host, User, plugin from user;
可以看到,root账户现在也是caching_sha2_password了
HostUserplugin
localhostmysql.infoschemacaching_sha2_password
localhostmysql.sessioncaching_sha2_password
localhostmysql.syscaching_sha2_password
localhostrootcaching_sha2_password

同时修改mysql的配置文件/usr/local/mysql-8.0/下的my.cnf文件,把里面的默认验证方式mysql_native_password修改为caching_sha2_password。

default_authentication_plugin=caching_sha2_password

完成后,重启mysql。

到此,重新查看error_log表,里面关于mysql_native_password的报错记录就没有了,说明现在的MySQL一切正常。

最后修改:2024 年 01 月 18 日
如果觉得我的文章对你有用,请随意赞赏