1.在/etc/my.cnf中加入skip-grant-tables
2.重启MySQL,无密码登录数据库
3.执行修改密码命令
update mysql.user set password=password('starcor@1234') where user='root'
4./etc/my.cnf中注释skip-grant-tables
5.重启MySQL,root密码即为修改后的密码
1.在/etc/my.cnf中加入skip-grant-tables
2.重启MySQL,无密码登录数据库
3.执行修改密码命令
update mysql.user set password=password('starcor@1234') where user='root'
4./etc/my.cnf中注释skip-grant-tables
5.重启MySQL,root密码即为修改后的密码
评论已关闭!