Product Documentation
https://demo4.strongkey.com/getstarted/assets/documents/HTML/images/key_strong_cyan.pngNOTE: This process requires Linux root as well as MariaDB root user access. It would be important keep an eye on the disk-space as this additional logging would occupy ~700MB of disk-space for ~1 Million transactions processed on the appliance.

 

  1. Login into the appliance as Linux root user.
  2. Login into the mysql command-line tool as the root user.
    shell> mysql -u root -p
  3. 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:


  4. Activate the plugin if Audit logging is not enabled with the following command:
    MariaDB> install plugin server_audit soname 'server_audit.so';
  5. 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;
  6. 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:


  7. Exit out of mysql.
    https://demo4.strongkey.com/getstarted/assets/documents/HTML/images/key_strong_cyan.pngNOTE: Audit logging should be enabled now; the log file can be viewed at /usr/local/strongauth/mariadb-10.5.8/ibdata/server_audit.log

     

  8. Make a backup copy of the MariaDB global configuration file /etc/my.cnf.
    shell> cp /etc/my.cnf ~/my.cnf.backup
  9. 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
  10. Save the file and exit from the text editor.
  11. 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