mysql 忘记root 密码处理方法

来源:互联网 发布:junos pulse mac 编辑:程序博客网 时间:2024/05/25 05:38

第一步修改mysql配置文件my.cnf

命令#vi /etc/my.cnf

把skip-grant-tables添加上去如图


保存退出
命令#:wq
重启mysql 服务器
命令#service mysqld restart
第二步修改密码
命令#mysql
命令#USE mysql; 
命令#UPDATE user SET Password = password ('123456') WHERE User = 'root' ;


第三步还原mysql配置文件my.cnf
就是去掉skip-grant-tables
完成了

0 0
原创粉丝点击