vi /etc/my.cnf
skip-grant-tables
systemctl restart mysqld
use mysql
update user set authentication_string = password("zwf") where user = "root";
vi /etc/my.cnf
#skip-grant-tables
systemctl restart mysqld
alter user root@localhost identified by 'zwf';