MySQL忘记密码

栏目: IT技术 · 发布时间: 6年前 · 65

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 )
猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Foundation Web Standards

Foundation Web Standards

Jonathan Lane、Steve Smith / Friends of ED / 21st July 2008 / $34.99

Foundation Web Standards explores the process of constructing a web site from start to finish. There is more to the process than just knowing HTML! Designers and developers must follow a proper proces......一起来看看 《Foundation Web Standards》 这本书的介绍吧!

CSS 压缩/解压工具

CSS 压缩/解压工具

在线压缩/解压 CSS 代码

RGB转16进制工具

RGB转16进制工具

RGB HEX 互转工具

HTML 编码/解码

HTML 编码/解码

HTML 编码/解码