如何在服务器运行时关闭mysql审核日志?

时间:2015-08-26 18:43:52

标签: mysql space audit-logging

我确实有一个高度活跃的服务器,无法重新启动它。我已经激活了审核日志但是由于空间问题,我需要将其关闭。以下是我的变量;

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 |

这是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

1 个答案:

答案 0 :(得分:1)

当FORCE_PLUS_PERMANENT看起来已注释掉时,您可以使用UNINSTALL PLUGIN命令,如下所示:

https://dev.mysql.com/doc/refman/5.5/en/server-plugin-loading.html#server-plugin-uninstalling

如果FORCE_PLUS_PERMANENT处于活动状态,那么您运气不好,因为这是为了保护审核日志免于即时禁用。

相关问题