您的位置:首页 > 数据库 > MySQL

[置顶] windows下mysql5.7忘记root密码后的解决方法

2017-05-30 20:20 411 查看
添加windows下mysql服务
以管理员身份打开cmd,执行
mysqld --install
net stop mysql
# 忘记密码找回
my.ini 的mysqld下添加
skip-grant-tables

# 启动mysql服务
net start mysqld
cd C:\Program Files\MySQL\MySQL Server 5.7\bin
mysql
use mysql
设置新密码
update mysql.user
set authentication_string=password('yongge999???')
where user='root' and Host =
'localhost';
flush privileges;
5.7以前版本可用UPDATE user SET Password=PASSWORD('newpassword') where USER='root';更新密码
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: