- Login into the appliance as Linux root user.
- Login into the mysql command-line tool as the root user.
shell> mysql -u root -p
- Check if the Server Audit Plugin is activated.
MariaDB> select * from information_schema.plugins where plugin_name='server_audit'\G
If it reruns an empty set, it means Audit logging is not activated ; if it has been activated, the response should look similar to the following:

- Activate the plugin if Audit logging is not enabled with the following command:
MariaDB> install plugin server_audit soname 'server_audit.so';
- Enable the following Audit configuration properties to enable the capability dynamically rather than to restart MariaDB:
MariaDB> set global server_audit_events='QUERY_DML_NO_SELECT';
MariaDB> set global server_audit_file_rotate_size=100000000;
MariaDB> set global server_audit_file_rotations=1000;
MariaDB> set global server_audit_logging=ON;
- Verify that the updated property values have the values just provided (as above):
MariaDB> show global variables like 'server_audit%';
The output should look similar to the following:

- Exit out of mysql.
NOTE: Audit logging should be enabled now; the log file can be viewed at /usr/local/strongauth/mariadb-10.5.8/ibdata/server_audit.log |
- Make a backup copy of the MariaDB global configuration file /etc/my.cnf.
shell> cp /etc/my.cnf ~/my.cnf.backup
- Edit the /etc/my.cnf file using text editor (e.g. vi) and add the following properties in the [mysqld] section of the configuration file:
server_audit_logging = ON
server_audit_events = QUERY_DML_NO_SELECT
server_audit_file_rotate_size = 100000000
server_audit_file_rotations = 1000
- Save the file and exit from the text editor.
- Confirm that the contents of the /etc/my.cnf file contain your newly added configuration properties by displaying the contents in the Terminal:
shell> cat /etc/my.cnf