centos mysql 1045 错误

前端之家收集整理的这篇文章主要介绍了centos mysql 1045 错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1、停用MySQL服务:# /etc/rc.d/init.d/MysqLd stop

2、输入命令:# MysqLd_safe --user=MysqL --skip-grant-tables --skip-networking &

3、登入数据库# MysqL -u root MysqL

4、MysqL> use MysqL;结果如下:

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

MysqL><登录成功>

原文链接:https://www.f2er.com/centos/378546.html

猜你在找的CentOS相关文章