修改配置文件: [root@Mysql-S mysql]# vim /etc/my.cnf 2.在 [mysqld] 这个模块添加以下内容。 skip-grant-tables 3.重启 MySQL。
[root@Mysql-S mysql]# vim /etc/my.cnf
2.在 [mysqld] 这个模块添加以下内容。
skip-grant-tables
3.重启 MySQL。
[root@MySQL-S mysql]# ./support-files/mysql.server restart
4.用空密码进入,回车。
[root@MySQL-S mysql]# mysql
mysql> alter user 'root'@'localhost' identified by '123456';
6.刷新:
mysql> flush privileges;
或:
update mysql.user set authentication_string=password('123456') where user='root' and Host = 'localhost';
--结束END--
本文标题: MySQL 5.7 忘记密码。
本文链接: https://www.lsjlt.com/news/41699.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0