linux 等保问题整改,MySQL升级 或者安装 查看临时密码报错。

13 篇文章 0 订阅
5 篇文章 0 订阅


linux 等保问题整改,MySQL升级 或者安装 查看临时密码报错。

linux 等保问题整改,MySQL升级 或者安装 查看临时密码报错。

问题:

Oracle MySQL Server 输入验证错误漏洞(CVE-2022-21367)
Oracle MySQL Server 输入验证错误漏洞(CVE-2022-21344)
Oracle MySQL 输入验证错误漏洞(CVE-2022-21417)

一、安装完MySQL数据库查看临时密码有两个

[root@localhost mysql5.7.38]# grep 'temporary password' /var/log/mysqld.log
2020-10-22T11:42:49.649516Z 1 [Note] A temporary password is generated for root@localhost: iIQuf,Ody3,*
2022-04-25T10:55:25.648438Z 1 [Note] A temporary password is generated for root@localhost: 4NyO_/g)K:7k

二、登录报错:

[root@localhost mysql5.7.38]# grep 'temporary password' /var/log/mysqld.log
2020-10-22T11:42:49.649516Z 1 [Note] A temporary password is generated for root@localhost: iIQuf,Ody3,*
2022-04-25T10:55:25.648438Z 1 [Note] A temporary password is generated for root@localhost: 4NyO_/g)K:7k
[root@localhost mysql5.7.38]# mysql -uroot -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@localhost mysql5.7.38]# mysql -uroot -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@localhost mysql5.7.38]# 

三、登录报错截图MySQL

在这里插入图片描述

四、解决方法:

第一步:添加skip-grant-tables,重启mysqld服务。设置密码为空。

[root@localhost mysql5.7.38]# vim /etc/my.cnf

vi /etc/my.cnf
 
skip-grant-tables

:wq

systemctl restart mysqld

mysql -uroot -p

use mysql;

update mysql.user set authentication_string=password('') where user='root'and Host ='localhost';

flush privileges;

quit;


在这里插入图片描述

第二步:删除skip-grant-tables,重启mysqld服务。

vi /etc/my.cnf
# 注释掉
#skip-grant-tables

# 光标移动到所在行 按dd
dd skip-grant-tables

:wq

systemctl restart mysqld

mysql -uroot -p 

在这里插入图片描述
第三步:设置密码root密码,开启远程登录。

[root@localhost mysql5.7.38]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.38 MySQL Community Server (GPL)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)

mysql> set global validate_password_length=4;
Query OK, 0 rows affected (0.00 sec)

mysql> set password for root@localhost=password('123456');
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> grant all privileges on *.* to root@'%' identified by '123456 ';
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
[root@localhost mysql5.7.38]# 

在这里插入图片描述

五、登录成功

[root@localhost mysqldata]# mysql -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 83
Server version: 5.7.38-log MySQL Community Server (GPL)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
11 rows in set (0.00 sec)


在这里插入图片描述
在这里插入图片描述

六、安装升级请看我写的文章 。

文章:
备份全库
然后在恢复就可以

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
MySQL整改是指对MySQL数据库进行安全等级评估和整改的过程。等是指信息系统安全等级护的简称,根据国家相关规定,不同等级的信息系统需要满足不同的安全要求。对于MySQL数据库的等整改,可以按照以下步骤进行: 1. 安全评估:对MySQL数据库进行全面的安全评估,包括物理安全、网络安全、系统安全、应用安全等方面,找出存在的安全隐患和问题。 2. 安全策略制定:根据评估结果,制定针对性的安全策略和措施。包括访问控制、用户权限管理、密码策略、日志审计、数据备份恢复等方面。 3. 系统硬化:对MySQL数据库服务器进行系统硬化,关闭不必要的服务和端口,设置防火墙,加强访问控制等。 4. 数据库配置优化:优化数据库配置参数,提高性能同时增加安全性。如合理设置缓冲区大小、最大连接数、超时时间等。 5. 安全审计:建立数据库安全审计机制,记录数据库操作日志,并定期进行审计和检查,及时发现并处理异常情况。 6. 漏洞修复和补丁升级:定期检查并修复MySQL数据库存在的漏洞,并及时升级安全补丁,证数据库的安全性。 7. 数据备份与恢复:建立完善的数据备份和恢复机制,定期备份数据库,并测试恢复过程,以应对数据丢失或系统故障等情况。 8. 培训与意识提升:加强员工安全意识培训,提高其对数据库安全的重视程度,增强信息安全管理能力。 需要注意的是,等整改是一个持续不断的过程,需要定期评估和更新安全策略,以应对不断变化的安全威胁。同时,也建议参考相关的安全标准和规范,如国家信息安全等级护标准等。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值