MySQL Audit Server_audit module

Source: Internet
Author: User
Tags syslog

The Server_audit module is a mariadb or skysql developed by a MySQL plugin. Can do some auditing on the above work.

As is known to all, MySQL is inside is very difficult to record user's Operation command. You can use this. Supports two formats of output, file or syslog.

1. Installation

' Server_audit ';
Server_audit.so can be downloaded with Skysql above, mariadb 10 is already self-contained. Very useful.

2. Configuration

Show variables like ' server_au% ';

| server_audit_events | |
| Server_audit_excl_users | |
| Server_audit_file_path | Server_audit.log |
| Server_audit_file_rotate_now | OFF |
| Server_audit_file_rotate_size | 1000000 |
| server_audit_file_rotations | 9 |
| Server_audit_incl_users | |
| server_audit_logging | On |
| Server_audit_mode | 0 |
| Server_audit_output_type | File |
| server_audit_syslog_facility | Log_user |
| server_audit_syslog_ident | mysql-server_auditing |
| Server_audit_syslog_info | |
| server_audit_syslog_priority | Log_info |

The default is recorded in the file, under DataDir. You can also change to syslog, the default is info this level, recorded on the/var/log/message.log above.

Output format

Jul 14:14:12 Zabbix mysql-server_auditing:xxxx.com,root,localhost,46,55,query,, ' Set global server_audit_output_ Type=syslog ', 0
Jul 14:20:15 Zabbix mysql-server_auditing:xxxx.com,root,localhost,46,0,disconnect,,, 0

Very clear, time, user, operation, can be recorded.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.