brew mysql@5.7忘记密码

1,修改配置文件

sudo vi /opt/homebrew/etc/my.cnf 在【mysqld】下添加配置 skip-grant-tables

 

 

2,重启服务 

brew services restart mysql@5.7 

3,进入mysql

mysql -uroot -p 回车进入mysql

4,修改密码

# 修改root账号密码
update mysql.user set authentication_string = password('123456') where user='root';

 

5,刷新权限

flush privileges;

 

6,将配置文件的skip-grant-tables删除,并重启mysql服务

brew services restart mysql@5.7 

 

posted @   Lafite-1820  阅读(429)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示