我确实有一个高度活跃的服务器并且无法重新启动它。很久以前,我已经激活了审核日志,但由于空间问题,我需要将其关闭。以下是我的变量;
audit_log_buffer_size | 1048576 | audit_log_connection_policy | ALL | audit_log_current_session | ON | audit_log_exclude_accounts | | audit_log_file | audit.log | audit_log_flush | OFF | audit_log_format | OLD | audit_log_include_accounts | | audit_log_policy | ALL | audit_log_rotate_on_size | 0 | audit_log_statement_policy | ALL | audit_log_strategy | ASYNCHRONOUS |
And here is my.cnf
plugin-load=audit_log.so
.
.
.
# Audit Log -
#--------------------------
#audit-log=FORCE_PLUS_PERMANENT
#audit_log_exclude_accounts=.....
#audit_log_file= /var/log/mysql/mysql_audit_db1.log
.
.
.
解决方案:
运行 UNINSTALL PLUGIN audit_log;
后,它停止为我记录 audit_log 文件。验证您是否可以使用 SHOW PLUGINS;
mysql> UNINSTALL PLUGIN audit_log;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> show warnings;
Warning | 1620 | Plugin is busy and will be uninstalled on shutdown enter code here
最佳答案
由于 FORCE_PLUS_PERMANENT 看起来被注释掉了,您可以使用 UNINSTALL PLUGIN 命令,如下所示:
https://dev.mysql.com/doc/refman/5.5/en/server-plugin-loading.html#server-plugin-uninstalling
如果 FORCE_PLUS_PERMANENT 处于事件状态,那么您就不走运了,因为这是为了防止审计日志被即时禁用。
关于mysql - 服务器运行时如何关闭mysql审计日志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32234343/