Mac下忘记mysql密码的办法

来源:互联网 发布:双色球中奖查询软件 编辑:程序博客网 时间:2024/05/17 02:53

1. 在系统偏好 中,中止MYSQL服务.;

2.

 cd /usr/local/mysql/bin
<span class="s1" style="font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="font-family: Arial; font-size: 14px; line-height: 26px;"> sudo ./mysqld_safe --skip-grant-tables</span>

3. 登录MySQL;

mysql

4. 置空root用户的密码; 

mysql> update mysql.user set password=‘’ whereUser='root'; mysql> flush privileges; mysql> quit

5. 重新启动MySQL服务。

6. 添加密码

mysql>set password =password('你的密码');mysql>flush privileges;

0 0
原创粉丝点击