zoukankan      html  css  js  c++  java
  • MySQL general log

    1:查看版本

    SELECT VERSION();
    

      

    2:查看当前的日志保存方式

    mysql> SHOW VARIABLES LIKE '%log_output%';
    +---------------+-------+
    | Variable_name | Value |
    +---------------+-------+
    | log_output    | TABLE |
    +---------------+-------+
    1 row in set (0.00 sec)
    

      

    3:查看当前是否开启了general log

    mysql> SHOW VARIABLES LIKE '%general_log%';
    +------------------+----------------------------+
    | Variable_name    | Value                      |
    +------------------+----------------------------+
    | general_log      | ON                         |
    | general_log_file | /var/run/mysqld/mysqld.log |
    +------------------+----------------------------+
    2 rows in set (0.00 sec)
    

      

    4:关闭打开general log

    mysql> SET GLOBAL GENERAL_LOG = ON;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> SET GLOBAL general_log_file ='/tmp/general.log';
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> SET GLOBAL GENERAL_LOG = OFF;
    Query OK, 0 rows affected (0.00 sec)
    

      

    5:设置日志的输出格式

    mysql> SHOW VARIABLES LIKE '%log_output%';
    +---------------+-------+
    | Variable_name | Value |
    +---------------+-------+
    | log_output    | FILE  |
    +---------------+-------+
    1 row in set (0.00 sec)
    
    mysql> SET GLOBAL log_output = 'TABLE';
    Query OK, 0 rows affected (0.00 sec)
    

      

  • 相关阅读:
    Shiro学习
    【工具】流程图软件
    使用python快速搭建web服务器
    接口并发测试
    什么是REST编程
    Linux下查看cpu使用率
    中文价格识别为数字 java代码
    mysql mvcc 的理解
    Nacos client 客户端cpu占用100% 问题排查和解决方案
    springboot 不停服动态更新定时任务时间(转)
  • 原文地址:https://www.cnblogs.com/xiaoit/p/4512549.html
Copyright © 2011-2022 走看看