# 3. 清空密码 UPDATE mysql.user SET authentication_string='' WHERE user='root' and host='localhost';
# 4. 修改密码 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '密码'; ## 如果报错了ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement,就执行 flush privileges; ## 然后再执行ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '密码';