Percona Audit Plugin -

SET GLOBAL audit_log_rotate = ON;

"msg-type": "activity", "date": "2023-10-27T10:15:30.000Z", "thread-id": "25", "query-id": "100", "user": "admin", "ip": "192.168.1.50", "host": "app-server-01", "pid": "12345", "os_user": "app_user", "appname": "mysqld", "rows": "1", "cmd": "QUERY", "query": "SELECT * FROM users WHERE id = 1", "status": "0" percona audit plugin

[mysqld] plugin-load = audit_log.so audit_log_format = JSON audit_log_policy = ALL audit_log_exclude_accounts = root@localhost audit_log_rotate_on_size = 1G audit_log_rotations = 5 SET GLOBAL audit_log_rotate = ON

The Percona Audit Plugin is an open-source plugin (compatible with MySQL, Percona Server, and MariaDB) that tracks database activity to help meet compliance standards and secure your data. percona audit plugin

:

If you want to force a log rotation immediately:

Ensure audit_log.so exists in that folder.