查询执行语句比较慢的设置方法:

show full processlist; 

show variables  like '%query%';   //查看query相关的参数设置

set global long_query_time = 2;   //设置最长查询时延为2s

set global slow_query_log =on;   // 将query日志打开

set global slow_query_log_file = ‘/data/log/mysql/slow_query.log';   //设置query日志的存储位置

mysql数据库如何定位分析哪些sql语句查询比较慢

mysql数据库如何定位分析哪些sql语句查询比较慢

找到对应的sql语句,然后对sql语句进行优化,比如create  index等

相关文章:

  • 2021-11-12
  • 2021-11-15
  • 2021-05-27
  • 2021-11-15
猜你喜欢
  • 2021-10-28
  • 2021-05-29
  • 2022-01-04
  • 2021-09-23
  • 2021-07-05
相关资源
相似解决方案