mysql在MAC安装时忘记初始随机密码的解决办法

来源:互联网 发布:java项目开发实录 编辑:程序博客网 时间:2024/05/18 12:01

首先置空密码后可直接登录

1. cd /usr/local/mysql/bin/ 2. sudo su ./mysqld_safe --skip-grant-tables & 3. 可能需要输入系统密码,正确输入后,现在的数据库密码将置为空

需要重新设置密码的话

update user set password=password("你的密码") where user="root";

如果是5.7的版本,那么应该是

update user set authentication_string=password("你的密码") where user="root";
0 0
原创粉丝点击