mysql5.7.20更改root密码

my.cnf

中在[mysqld]下面增加

skip-grant-tables

使用空密码登录数据库执行下面命令

update mysql.user set authentication_string=PASSWORD('newpassword') where User='root'; 

原文地址:https://www.cnblogs.com/net2817/p/8075497.html