900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > Linux运维学习中mysql root密码忘记了怎么办?

Linux运维学习中mysql root密码忘记了怎么办?

时间:2024-03-24 20:34:05

相关推荐

Linux运维学习中mysql root密码忘记了怎么办?

随着互联网技术的迅猛发展,现在逐步渐入大数据、云计算、虚拟技术和人工智能时代,技术为王的现象越来越明显了。学习Linux云计算的人越来越多了。Linux运维学习中mysql root密码忘记了怎么办?

1. 挂维护页

2. 关数据库

[root@db01 ~]# systemctl stop mysqld

3. 跳过授权启动

[root@db01 ~]# mysqld_safe --skip-grant-tables --skip-networking &

--skip-grant-tables : 连接层关闭验证模块,所有验证表不加载。

--skip-networking :连接层关闭TCP/IP协议,禁止远程访问。

4. 改密码

mysql> alter user root@'localhost' identified by '456';

ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

mysql>

mysql>

mysql>

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql> alter user root@'localhost' identified by '456';

Query OK, 0 rows affected (0.00 sec)

mysql>

[root@db01 ~]# pkill mysqld

[root@db01 ~]# systemctl start mysqld

5.正常开启业务

想要众多的IT工作者中脱颖而出,就需要拥有高深的技术,学习增值是必不可少的。学习之路,是贵在坚持的。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。