您的位置:首页 > 博客中心 > 数据库 >

mysql8.0版本忘记root密码

时间:2022-03-15 12:01

1、先关掉系统服务

net stop mysql

2、进入mysql安装目录的bin文件中,以管理员的方式运行cmd,然后输入如下命令,实现无密码登陆

mysqld --console --skip-grant-tables --shared-memory

3、以空密码登入系统

mysql.exe -u root

4、重置密码

UPDATE mysql.user SET authentication_string='root' WHERE user='root' and host='localhost';

5、ok

本类排行

今日推荐

热门手游