centos 重置数据库 root 密码。

vim /etc/my.cnf
skip-grant-tables
systemctl stop mysqld
systemctl start mysqld
mysql
mysql> use mysql
mysql> update user set password=password("12345678") where user='root'
mysql> flush privileges
exit
❤️ 转载文章请注明出处,谢谢!❤️