skip-grant-tables
mysql -u root -p
use mysql;ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH mysql_native_password BY ‘你的密码‘;
注意:修改完后,记得注释掉 my.cnf 中的 skip-grant-tables 参数,