Home >Database >Mysql Tutorial >mysql:打开通用查询和慢查询_MySQL

mysql:打开通用查询和慢查询_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 14:01:42987browse

 打开通用查询日志:记录所有查询日志.该日志路经默认在/var/lib/mysql下.名字默认为"机器名.log"

  vi /etc/my.cnf

  [mysqld]

  ...

  log

  ...

  打开慢查询日志: 记录所有慢查询日志(该例阀门为2秒).

  vi /etc/my.cnf

  [mysqld]

  ...

  log-slow-queries = /var/log/mysqlslowquery.log

  long_query_time = 2

  .....

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