MySQL配置查询日志
general_log_file=/tmp/mariadb_general_log.log
general_log=onshow variables like 'general_log'; #查看日志是否开启
set global general_log=on; #开启日志功能
show variables like 'general_log_file'; #看看日志文件保存位置
set global general_log_file='tmp/general.log'; #设置日志文件保存位置
show variables like 'log_output'; #看看日志输出类型 table或file
set global log_output='table'; #设置输出类型为 table
set global log_output='file'; #设置输出类型为file控制日志大小
/tmp/general.log {
daily
rotate 7
missingok
maxsize 1G
nocompress
notifempty
copytruncate
}最后更新于