mysql - 服务器运行时如何关闭mysql审计日志?

标签 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 |

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/

相关文章:

mysql - 连接docker搭建的mysql服务器时得到 "Connection refused"

java - 在 Java 中如何将 "space and dot"替换为 "dot"?

authentication - CakePHP 3 : Accessing current user in model

postgresql - 有没有办法测量 PostgreSQL 实例中的日志量?

sql-server - 在 SQL Server 中获取用户名的 DDL 触发器

sql - 在所有表中搜索字符串

mysql - 带有国家字符的列错误的数据太长

php - 使用 mysql_fetch_assoc 时如何跳过一行?

java - iText 忽略图像后添加的空间

mysql - 删除不间断空格?