zoukankan      html  css  js  c++  java
  • MariaDB日志类型

    MariaDB日志类型
    日志
    1.binary log
    记录数据库所有修改动作的事件描述,二进制格式,需要和服务器兼容的mysqlbinlog来读取
    开启方式:
    [mysqld]
    log_bin=/opt/mariadb/data/mysql_bin #log_bin=mysql_bin默认也是放在data目录

    读取binlog
    mysqlbinlog /opt/mariadb/data/mysql-bin.000001
    2.error log(critical errors)
    记录数据库startup,shutdown,fails 默认文件名为hostname.err,
    开启方式:
    [mysqld]
    log_error  = /opt/mariadb/log/mysqld.log

    3.general query log(performance killer)
    默认禁用, 任何对mysql的操作都会记录日志,即使没有改变任何数据,
    开启方式:
    [mysqld]
    general_log = 1 #on(=1), off(=0)
    general_log_file = /opt/mariadb/log/general.log

    4.slow query log(optimizing&tuning)
    默认禁用,数据库调优时非常有用
    开启方式:

    [mysqld]

    slow_query_log = 1

    slow_query_log_file = /opt/mariadb/log/mysqld-slow.log

    long_query_time = 0.05

    log_slow_rate_limit = 30 #记录slow query的频率,默认是每次都记录,适当的值可以避免日志暴涨

    log_slow_verbosity = query_plan,standard


    #log_slow_verbosity有如下几个参数

    • microtime: Makes the log to log the queries in microseconds

    • query_plan: Logs query execution plan information

    • innodb: Adds additional statistical information about queries that touch XtraDB and InnoDB tables

    • standard: Turns on both the microtime and innodb variables

    • full: Turns on all options

    • profiling: Allows the logged queries to be pro led 


  • 相关阅读:
    SpringBoot list查询方法
    eclipse创建web项目
    loadrunner获取返回值为乱码
    连接数据库
    lr并发量和迭代的区别
    LoadRunner11.00入门教程出现的问题
    python学习杂记--函数参数的设置
    adb logcat的命令行开启和关闭
    python学习杂记--pycharm控制台输出乱码
    python学习杂记--装饰器
  • 原文地址:https://www.cnblogs.com/lixuebin/p/10814215.html
Copyright © 2011-2022 走看看