我有一個高度活躍的服務器,無法重新啓動它。很久以前,我已經激活了審計日誌,但由於空間問題,我需要關閉它。以下是我的變數;如何在服務器運行時關閉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
UNINSTALL PLUGIN plugin_name; 請參閱:https://mariadb.com/kb/en/mariadb/uninstall-plugin/ –
卸載插件鏈接信息聽起來不是非常動態和不重新啓動 – Drew
我運行此命令,這裏是結果。它爲我工作。 Nomore日誌記錄>>>>>> mysql> UNINSTALL PLUGIN audit_log; Query OK,0 rows affected,1 warning(0.00 sec) >>>>>>>> mysql> show warnings; 警告| 1620 |插件正忙,將在關機時卸載 –