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.