Home > Database > Mysql Tutorial > mysql日志管理分析调试实例_MySQL

mysql日志管理分析调试实例_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 14:01:43
Original
1010 people have browsed it

  以下的文章主要介绍的是MySQL 操作日志查看的实际操作步骤以及对其实际操作步骤的具体描述,假如你在实际操作中遇到相似的情况,但是你却不知道对其如何正确的解决,那么以下的文章对你而言一定是良师益友。

  刚接触MySQL不久,发现缺少比较多企业级的功能,想实时查看MySQL所执行的sql语句,类似mssql里的事件探查器,上网找了一下,只能将执行操作写到日志里,做法如下:

  对my.ini文件进行设置,我的MySQL安装环境是xp sp2,该文件在c:/windows/..下,打开文件进行修改

  [MySQLd]

  basedir=E:/MySQL 4.0.12

  #bind-address=192.168.15.196

  datadir=E:/MySQL 4.0.12/data

  #language=E:/MySQL 4.0.12/share/your language directory

  #slow query log#=slowqueris.log

  #tmpdir#=

  #port=3306

  #set-variable=key_buffer=16M

  long_query_time =1 --是指执行超过多久的sql会被log下来,这里是1秒

  log-slow-queries=slowqueris.log --将查询返回较慢的语句进行记录

  log-queries-not-using-indexes = nouseindex.log --就是字面意思,log下来没有使用索引的query

  log=mylog.log --对所有执行语句进行记录

  以上参数开启后,可能会影响MySQL性能,在生产环境下建议关闭

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template