Blogger Information
Blog 91
fans 0
comment 0
visits 203644
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
MYSQL忘记root密码怎么办?
何澤小生的博客
Original
882 people have browsed it

1.修改MySQL的登录设置:

# vi /etc/my.cnf

在[mysqld]的段中加上一句:skip-grant-tables 保存并且退出vi。

2.重新启动mysqld

# /etc/init.d/mysqld restart ( service mysqld restart )

3.登录并修改MySQL的root密码

mysql> USE mysql ;
mysql> UPDATE user SET Password = password ( 'new-password' ) WHERE User = 'root' ;
mysql> flush privileges ;
mysql> quit

4.将MySQL的登录设置修改回来

# vi /etc/my.cnf

将刚才在[mysqld]的段中加上的skip-grant-tables删除保存并且退出vi。

5.重新启动mysqld

# /etc/init.d/mysqld restart ( service mysqld restart )


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post