软件
mysql更改密码(MySQL修改密码)

拥有原来的用户名账户的密码


忘记原来root密码


service mysqld stop


vim /etc/my.cnf

如图,将:

MySQL修改密码nerror="javascript:errorimg.call(this);">


service mysqld start


mysql -u root -p


第五步:设置root用户密码

注意:代码中root_password就是新设置的密码

use mysql;update mysql.user set authentication_string=password('root_password') where user='root';  


第六步:退出MySQL,关闭MySQL服务,将my.cnf中的skip-grant-tables注释

关闭MySQL服务


service mysqld stop

注释skip-grant-tables,如图

MySQL修改密码nerror="javascript:errorimg.call(this);">

启动MySQL服务


service mysqld start


第七步:重新进入MySQL,输入新配置的密码


顶一下()     踩一下()

热门推荐

发表评论
0评