content_image/711208.jpg content_image/711221.jpg
<img src='content_image/711208.jpg'>

mysql.user  system table. For upgrades to an installation for which MySQL Enterprise Audit is already installed, it is recommended that you alter the table definitions as follows: 

ALTER TABLE mysql.audit_log_user DROP FOREIGN KEY audit_log_user_ibfk_1; ALTER TABLE mysql.audit_log_filter CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci; ALTER TABLE mysql.audit_log_user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci; ALTER TABLE mysql.audit_log_user MODIFY COLUMN USER VARCHAR(32); ALTER TABLE mysql.audit_log_user ADD FOREIGN KEY (FILTERNAME) REFERENCES mysql.audit_log_filter(NAME); 

## Note 

To use MySQL Enterprise Audit in the context of source/replica replication, Group Replication, or InnoDB Cluster, you must prepare the replica nodes prior to running the installation script on the source node. This is necessary because the INSTALL PLUGIN  statement in the script is not replicated. 

1. On each replica node, extract the INSTALL PLUGIN  statement from the installation script and execute it manually. 

2. On the source node, run the installation script as described previously. 

To verify plugin installation, examine the INFORMATION_SCHEMA.PLUGINS  table or use the SHOW PLUGINS  statement (see Section 5.6.2, “Obtaining Server Plugin Information” ). For example: 

mysql> SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE ’audit%’; +-------------+---------------+ | PLUGIN_NAME | PLUGIN_STATUS | +-------------+---------------+ | audit_log | ACTIVE | +-------------+---------------+ 

If the plugin fails to initialize, check the server error log for diagnostic messages. 

After MySQL Enterprise Audit is installed, you can use the --audit-log  option for subsequent server startups to control audit_log  plugin activation. For example, to prevent the plugin from being removed at runtime, use this option: 

[mysqld] audit-log=FORCE_PLUS_PERMANENT 

If it is desired to prevent the server from running without the audit plugin, use --audit-log  with a value of FORCE  or FORCE_PLUS_PERMANENT  to force server startup to fail if the plugin does not initialize successfully. 

<img src='content_image/711221.jpg'>

## Important 

By default, rule-based audit log filtering logs no auditable events for any users. This differs from legacy audit log behavior, which logs all auditable events for all users (see Section 6.4.5.9, “Legacy Mode Audit Log Filtering” ). Should you wish to produce log-everything behavior with rule-based filtering, create a simple filter to enable logging and assign it to the default account: 

SELECT audit_log_filter_set_filter(’log_all’, ’{ "filter": { "log": true } }’); 

