首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >general_log 问题处理1

general_log 问题处理1

作者头像
franket
发布2022-03-21 18:21:24
发布2022-03-21 18:21:24
3100
举报
文章被收录于专栏:技术杂记技术杂记

普通日志(general log) 可以提供一种机制,能将打开日志期间所有的语句记录下来,由于开销比较大,所以正常情况下是关闭的,只在进行深度分析时打开

General query log A type of log used for diagnosis and troubleshooting of SQL statements processed by the MySQL server. Can be stored in a file or in a database table. You must enable this feature through the general_log configuration option to use it. You can disable it for a specific connection through the sql_log_off configuration option. Records a broader range of queries than the slow query log. Unlike the binary log, which is used for replication, the general query log contains SELECT statements and does not maintain strict ordering

代码语言:javascript
复制
mysql> show variables like "%general%";
+------------------+-----------------------------------+
| Variable_name    | Value                             |
+------------------+-----------------------------------+
| general_log      | OFF                               |
| general_log_file | /var/lib/mysql/general.log        |
+------------------+-----------------------------------+
2 rows in set (0.00 sec)

mysql> 

如果 log_output 设定为 FILE ,则会记录到 general_log_file 中去

代码语言:javascript
复制
mysql> show variables like "%log_output%";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| log_output    | FILE  |
+---------------+-------+
1 row in set (0.00 sec)

mysql> 

如果为 TABLE 则会写到 mysql.general_log 中,关于general_log的详细机制,可以参考附录中的相关资料

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档