mysql数据库过期处理

这篇博客介绍了如何在MySQL 5.7中重置root用户的密码,包括使用ALTER USER语句和编辑my.ini配置文件的方法。同时,还讲解了如何更新用户权限状态,避免密码过期并刷新权限。在完成操作后,需记得取消my.ini中的skip-grant-tables注释并重启MySQL服务。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

:You must reset your password using ALTER USER statement before executing this statement.
--alter user 'root'@'localhost' identified by '123456';

D:\ProgramData\MySQL\MySQL Server 5.7\my.ini,最后面加上skip-grant-tables,重启mysql服务
update mysql.user set authentication_string=password('root'),password_last_changed = NOW() where user='root';
update mysql.user set password_expired='N' where user='root';
flush privileges;

在my.ini最后skip-grant-tables,加上#屏蔽。

重启mysql服务


mysql5.0:
update user set password=password("new_pass") where user="root";

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值