# 跳过校验 sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf # 添加一行 skip-grant-tables # 重启服务
# 登录 mysql -uroot -p
# 更改密码 update user set authentication_string=''where user='root'; flush privileges; ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'xxxxxx';