MySQL Enterprise Audit +------------------------------+ | NULL | +------------------------------+ If a user name or host name requires quoting because it contains a comma, space, or other special character, quote it using single quotes. If the variable value itself is quoted with single quotes, double each inner single quote or escape it with a backslash. The following statements each enable audit logging for the local  root  account and are equivalent, even though the quoting styles differ: The last statement does not work if the  ANSI_QUOTES  SQL mode is enabled because in that mode double quotes signify identifier quoting, not string quoting. To filter audited events based on status, set the following system variables at server startup or runtime. These variables apply only for legacy audit log filtering. For JSON audit log filtering, different status variables apply; see Audit Log Options and Variables. SET GLOBAL audit_log_include_accounts = ’root@localhost’; SET GLOBAL audit_log_include_accounts = ’’’root’’@’’localhost’’’; SET GLOBAL audit_log_include_accounts = ’\’root\’@\’localhost\’’; SET GLOBAL audit_log_include_accounts = "’root’@’localhost’"; Event Filtering by Status • audit_log_connection_policy : Logging policy for connection events • audit_log_statement_policy : Logging policy for statement events Each variable takes a value of  ALL  (log all associated events; this is the default),  ERRORS  (log only failed events), or  NONE  (do not log events). For example, to log all statement events but only failed connection events, use these settings: Another policy system variable,  audit_log_policy , is available but does not afford as much control as audit_log_connection_policy  and  audit_log_statement_policy . It can be set only at server startup. At runtime, it is a read-only variable. It takes a value of  ALL  (log all events; this is the default), LOGINS  (log connection events),  QUERIES  (log statement events), or  NONE  (do not log events). For any of those values, the audit log plugin logs all selected events without distinction as to success or failure. Use of audit_log_policy  at startup works as follows: •If you do not set  audit_log_policy  or set it to its default of  ALL , any explicit settings for audit_log_connection_policy  or  audit_log_statement_policy  apply as specified. If not specified, they default to  ALL . •If you set  audit_log_policy  to a non- ALL  value, that value takes precedence over and is used to set  audit_log_connection_policy  and  audit_log_statement_policy , as indicated in the following table. If you also set either of those variables to a value other than their default of  ALL , the server writes a message to the error log to indicate that their values are being overridden. SET GLOBAL audit_log_statement_policy = ALL; SET GLOBAL audit_log_connection_policy = ERRORS; Startup audit_log_policy Value Resulting audit_log_connection_policy Value Resulting audit_log_statement_policy Value LOGINS ALL NONE QUERIES NONE ALL NONE NONE NONE 1520