2015-08-26 133 views
1

我有一个高度活跃的服务器,无法重新启动它。很久以前,我已经激活了审计日志,但由于空间问题,我需要关闭它。以下是我的变数;如何在服务器运行时关闭mysql审计日志?

 
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 
+0

UNINSTALL PLUGIN plugin_name; 请参阅:https://mariadb.com/kb/en/mariadb/uninstall-plugin/ –

+0

卸载插件链接信息听起来不是非常动态和不重新启动 – Drew

+0

我运行此命令,这里是结果。它为我工作。 Nomore日志记录>>>>>> mysql> UNINSTALL PLUGIN audit_log; Query OK,0 rows affected,1 warning(0.00 sec) >>>>>>>> mysql> show warnings; 警告| 1620 |插件正忙,将在关机时卸载 –

回答

1

由于FORCE_PLUS_PERMANENT看起来注释掉,您可以使用卸载plugin命令,书面这里:

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

如果FORCE_PLUS_PERMANENT是活动的,你运气不好,因为这是为了保护审计日志不被动态禁用。

+0

看起来已安装。 audit_log | ACTIVE | AUDIT | audit_log.so | PROPRIETARY | –

+0

然后,您可以尝试使用uninstall plugin命令将其卸载。如果它没有帮助,你将不得不关闭MySQL服务器一会儿。 – PetrosHu