1、停用MySQL服务:# /etc/rc.d/init.d/MysqLd stop
2、输入命令:# MysqLd_safe --user=MysqL --skip-grant-tables --skip-networking &
Database changed
5、MysqL> UPDATE user SET Password=PASSWORD('newpassword')where USER='newuser';
结果如下:
Query OK,3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
MysqL> FLUSH PRIVILEGES;
MysqL> quit
# /etc/init.d/MysqLd restart
# MysqL -unewuser–p
Enter password:newpassword
原文链接:https://www.f2er.com/centos/378546.html