The MariaDB Audit Plugin is supported for MySQL 5.7 versions up to 5.7.30 and is bundled with MariaDB.
To configure MySQL 5.7 event reporting using the MariaDB Audit Plugin:
You can download the MariaDB distribution kit from the official MariaDB website. The operating system of the MariaDB distribution must be the same as the operating system on which MySQL 5.7 is running.
mysql -u
<username>
-p
SHOW GLOBAL VARIABLES LIKE 'plugin_dir'
<directory to which the distribution kit was extracted>
/mariadb-server-<version>
/lib/plugins/server_audit.so.chmod 755
<directory to which the distribution kit was extracted>
server_audit.so
For example:
chmod 755 /usr/lib64/mysql/plugin/server_audit.so
install plugin server_audit soname 'server_audit.so'
[mysqld]
section, add the following lines:server_audit_logging=1
server_audit_events=connect,table,query_ddl,query_dml,query_dcl
server_audit_output_type=SYSLOG
server_audit_syslog_facility=LOG_SYSLOG
If you want to disable event export for certain audit event groups, remove some of the values from the server_audit_events
setting. Descriptions of settings are available on the MariaDB Audit Plugin vendor's website.
systemctl restart mysqld
for a system with systemd initialization.service mysqld restart
for a system with init initialization.MariaDB Audit Plugin for MySQL 5.7 is configured. If necessary, you can run the following commands on the MySQL 5.7 command line:
show plugins
to check the list of current plugins.SHOW GLOBAL VARIABLES LIKE 'server_audit%'
to check the current audit settings.