Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Percona mysql 5.6How to use the audit log function

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article is about how to use the audit log function of Percona mysql 5.6to share with you. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

[mysqld]

Plugin-load= "audit_log=audit_log.so"

INSTALL PLUGIN audit_log SONAME 'audit_log.so'

Show plugins

Show global variables like 'audit%'

The audit_log_rotate_on_size parameter indicates that if it exceeds the defined value, it will automatically rotate training and split the log.

The audit_log_rotations parameter limits the number of files.

# # Audit Logging # #

Audit_log_policy=ALL

Audit_log_format=JSON

Audit_log_file=/var/log/mysql/audit.log

Audit_log_rotate_on_size=1024M

Audit_log_rotations=10

Audit_log_strategy: set audit log policy, ASYNCHRONOUS (default, use memory buffer, do not delete messages if buffer is full), PERFORMANCE (use memory buffer, delete messages if buffer is full), SEMISYNCHRONOUS (log directly to file, no refresh and synchronization), SYNCHRONOUS (log directly to file, every event is refreshed and synchronized)

Audit_log_file: specify the log file. You can specify an absolute path. If no path is specified, it will be stored in the data directory.

Audit_log_flush: set to ON, log can be closed and reopened for manual log rotation

Audit_log_buffer_size: specifies the memory buffer of the audit log, when audit_log_strategy is ASYNCHRONOUS,PERFORMANCE

Audit_log_format: specify audit log format, OLD log is xml attribute, NEW log is XML tag

Audit_log_policy: specify which events are logged, ALL (all events), LOGINS (user login events only), QUERIES (query statements only), NONE (no events are logged)

Audit_log_rotate_on_size: set the size of the audit log. If the log reaches the set value, it will rotate automatically.

Audit_log_rotations: specify the number of audit log files

/ / query statement only

Set global audit_log_policy=QUERIES

/ / close the audit

Set global audit_log_policy=NONE

Thank you for reading! This is the end of the article on "how to use the audit log function of Percona mysql 5.6". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report