mysql5.7.10开启慢查询详解

作者:jingxian 时间:2024-01-18 10:23:23 

如下所示:


#在/etc/my.cnf中的[mysqld]中加入如下代码:
slow-query-log=On
slow_query_log_file=/data/mysql/log/mysql_slow_query.log
long_query_time=2
log_queries_not_using_indexes = ON

第一句是开启慢查询

第二句是用来定义慢查询日志的路径

第三句是用来定义查过多少秒的查询算是慢查询,我这里定义的是2秒

第四句就是记录下没有使用索引的query

标签:mysql,开启,慢查询
0
投稿

猜你喜欢

  • python实现贪吃蛇双人大战

    2022-10-10 19:18:37
  • Pandas数据结构详细说明及如何创建Series,DataFrame对象方法

    2021-03-14 12:13:35
  • Python打包方法Pyinstaller的使用

    2022-06-08 13:25:21
  • MySQL数据库备份与恢复方法

    2024-01-18 08:54:10
  • pandas group分组与agg聚合的实例

    2023-01-04 14:22:28
  • 伪静态下不能使用FCKeditor的解决方法

    2023-02-03 06:54:20
  • python轮询机制控制led实例

    2023-12-12 01:39:00
  • python datetime 和时间戳互相转换问题

    2023-12-31 05:32:26
  • pytorch中Schedule与warmup_steps的用法说明

    2023-07-07 00:18:14
  • python实现12306火车票查询器

    2021-04-07 16:05:58
  • 用MyEclipse配置DataBase Explorer(图示)

    2024-01-26 01:43:28
  • 微信小程序基于slider组件动态修改标签透明度的方法示例

    2024-05-11 09:42:14
  • MySQL中表复制:create table like 与 create table as select

    2024-01-25 06:31:46
  • python 内置函数-range()+zip()+sorted()+map()+reduce()+filter()

    2022-09-23 19:48:01
  • 利用 Python ElementTree 生成 xml的实例

    2022-04-14 08:32:48
  • MongoDB与MySQL常用操作语句对照

    2024-01-13 12:08:17
  • html注释所引起的一系列问题

    2008-11-04 13:23:00
  • python调用百度语音REST API

    2022-09-16 18:19:07
  • python 将字符串中的数字相加求和的实现

    2022-11-03 22:31:08
  • 使用python 写一个静态服务(实战)

    2023-09-29 15:57:25
  • asp之家 网络编程 m.aspxhome.com