Installation - trellix-enterprise/mysql-audit GitHub Wiki
Download the latest binary release from: https://github.com/mcafee/mysql-audit/releases.
Make sure to download the proper binary distribution. There are separate binaries for MySQL (5.1, 5.5, 5.6, 5.7), MariaDB (5.5, 10.0, 10.1, 10.2), and Percona (5.7.19) according to platform (32 or 64 bit). Please note:
- The binary for MariaDB 10.2 is for 10.2.10 and later.
- Only 64-bit binaries are supplied for Percona.
The Plugin file is available in the zip binary distribution under the lib dir. File name: libaudit/_plugin.so. To install the AUDIT Plugin, copy libaudit/_plugin.so to the plugin/_dir (for example /usr/lib/mysql/plugin or /usr/lib64/mysql/plugin ) of MySQL.
To see the configured plugin dir, login to MySQL and issue the following command:
show global variables like 'plugin_dir';
There are 2 options for installing the plugin via plugin-load configuration option or by issuing the INSTALL PLUGIN statement.
Installing via: plugin-load
Add to the MySQL option file (my.cnf) at the [mysqld] section the option:
plugin-load=AUDIT=libaudit_plugin.so
Restart the mysqld server for the changes to take effect.
Installing via: INSTALL PLUGIN
You will need to issue the following sql command to install the plugin:
INSTALL PLUGIN AUDIT SONAME 'libaudit_plugin.so';
A restart to the mysqld server is not necessary.
Note: On production systems, McAfee recommends using the plugin-load option for installing the audit plugin.
More info on installing MySQL plugins is available at: http://dev.mysql.com/doc/refman/5.1/en/plugin-installing-uninstalling.html
Verification
To check if the plugin is installed successfully you can issue the following command, which will show all installed plugins:
show plugins;
The AUDIT plugin will show up with the name AUDIT. Additionally you can verify the version of the AUDIT Plugin by running the following command:
show global status like 'AUDIT_version';
Troubleshooting
See: Troubleshooting