原创文章链接:https://blog.csdn.net/u013580397/article/details/89817347
Windows 中,Mysql 8.0 修改密码过程和 Mysql 5.6 及之前的版本有所区别。
net stop mysql
关闭服务,并以以下命令行开启服务,并绕过权限检查 1 mysqld --console --skip-grant-tables --shared-memory
mysql -u root
直接登陆,接着输入以下命令,将 root 密码置为空。 1 UPDATE mysql.user SET authentication_string=‘‘ WHERE user=‘root‘ and host=‘localhost‘;
net start mysql
启动 mysql 服务,输入 mysql -u root
直接登陆,通过以下命令设置 root 用户的密码。 1 ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘your password‘;
原文:https://www.cnblogs.com/lveyHang/p/12054756.html