版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yonggeit/article/details/72811510
添加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';更新密码