重置mysql密码

 

1.停止mysql服务器运行,-> service mysql stop

2.进入 mysql 安装目录 /usr/bin/

-> mysqld --skip-grant-tables 

3. 重新打开远程连接,进入mysql 重置密码

mysql> UPDATE mysql.user SET Password=PASSWORD('lianruihong')  WHERE User='root';
mysql> FLUSH PRIVILEGES;

连接mysql的时候发生这个错误:

ERROR 1130: Host [ip] is not allowed to connect to this MySQL server

mysql>update user set host = '%' where user = 'root';

posted on 2017-10-12 14:41  lianruihong  阅读(104)  评论(0编辑  收藏  举报

导航