Home  >  Article  >  Database  >  mysql慢查询日志命令_MySQL

mysql慢查询日志命令_MySQL

WBOY
WBOYOriginal
2016-06-01 13:07:41993browse

set global long_query_time=10 #设置慢查询时间为10秒

show global variables like 'long%' #查询慢时间记录

mysqldumpslow -t 10 /data/mysqldata/slowquery.log #从日至文件中查询前十条慢查询记录


my.cnf > 命令设置

log-queries-not-using-indexes  #记录下没有使用索引的记录

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn