Linux数据库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工作者中脱颖而出,就需要拥有高深的技术,学习增值是必不可少的。学习之路,是贵在坚持的。
试听课程热线:18710030740 QQ:768386696
老男孩IT教育:北京/上海/深圳 Python linux GO 网络安全 软件测试周末、脱产、网络课程
没有找到相关结果
0 个回复