GreatSQL 数据库是一款 开源免费 数据库,可在普通硬件上满足金融级应用场景,具有 高可用、高性能、高兼容、高安全 等特性,可作为 MySQL 或 Percona Server for MySQL 的理想可选替换。

8月5日,GreatSQL 8.0.32-26 版本发布,对应的 Docker 镜像已推送,此次还提供了阿里云 ACR 镜像。

GreatSQL 8.0.32-26 版本在 高可用、高性能、高兼容、高安全 等多方面都有增强新特性。

其中在高安全方面,新增两个特性。

  • 新增支持记录指定用户的最后一次登入时间,便于管理员查询,进一步提升数据库安全性。
  • 新增支持基于规则的数据脱敏功能。

下面演示“最后登录信息”功能。

拉取镜像。

podman pull registry.cn-beijing.aliyuncs.com/greatsql/greatsql:latest

启动容器。

podman run --name greatsql8032 -e MYSQL_ROOT_PASSWORD=1 -e MYSQL_ROOT_HOST='%' -d 2792645e3d14

连接数据库。

podman exec -it greatsql8032 mysql -uroot -p1
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.32-26 GreatSQL (GPL), Release 26, Revision a68b3034c3d

Copyright (c) 2021-2024 GreatDB Software Co., Ltd
Copyright (c) 2009-2024 Percona LLC and/or its affiliates
Copyright (c) 2000, 2024, 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.

(Wed Aug  7 23:07:36 2024)[root@GreatSQL][(none)]>

安装审计插件

source /usr/share/mysql/install_audit_log.sql

启用审计表和审计入表特性

SET GLOBAL audit_log_enabled = 1;
SET GLOBAL audit_log_to_table = 1;

查看审计表。

(Wed Aug  7 23:08:26 2024)[root@GreatSQL][(none)]>select * from sys_audit.audit_log\G
*************************** 1. row ***************************
          name: Query
        record: 3306186_6_2024-08-07T23:08:05
     timestamp: 2024-08-07 23:08:26
 command_class: set_option
 connection_id: 10
        status: 0
       sqltext: SET GLOBAL audit_log_to_table = 1
          user: root[root] @ localhost []
          host: localhost
     priv_user:
       os_user:
            ip:
            db:
server_version:
    os_version:
     server_id: 3306186
       timegmt: 1723039706163358
1 row in set (0.00 sec)

查询最后登录信息。

(Wed Aug  7 23:46:36 2024)[root@GreatSQL][(none)]>SELECT audit_login_messages(10);
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| audit_login_messages(10)                                                                                                                                             |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | name | time | connection_id | status | user | host | ip | server_id |
| Connect | 2024-08-07 23:46:27 | 108 | 0 | root | localhost |  | 3306186 |
| Total 1 rows | |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

切换普通用户,继续查询。

(Wed Aug  7 23:46:03 2024)[mytest@GreatSQL][(none)]>SELECT audit_login_messages(10);
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| audit_login_messages(10)                                                                                                                                              |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | name | time | connection_id | status | user | host | ip | server_id |
| Connect | 2024-08-07 23:46:00 | 98 | 0 | mytest | localhost |  | 3306186 |
| Total 1 rows | |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

GreatSQL 8.0.32-26 版本的发布,不仅在功能上进行增强,也在持续关注和投入数据库性能和安全性。GreatSQL 新增适配龙芯、申威等国产硬件,在信创软硬件生态方面更进一步。

更多内容请参阅:

https://greatsql.cn/docs/8.0.32-26/1-docs-intro/relnotes/chan...


🌻 往期精彩 ▼


-- / END / --

👉 这里可以找到我

如果这篇文章为你带来了灵感或启发,就请帮忙点『』or『在看』or『转发』吧,感谢!ღ( ´・ᴗ・` )~

本文由mdnice多平台发布


严少安
6 声望4 粉丝

DBA