Home > Database > Mysql Tutorial > body text

mysql通过查看跟踪日志跟踪执行的sql语句_MySQL

WBOY
Release: 2016-06-01 13:26:07
Original
964 people have browsed it

bitsCN.com

在SQL SERVER下跟踪sql采用事件探查器,而在mysql下如何跟踪sql呢?

其实方法很简单,开启mysql的日志log功能,通过查看跟踪日志即可。

开启mysql的日志log方法:

windows环境下的配置方法:

我使用的版本:Version: 5.0.37-community-nt-log (MySQL Community Edition (GPL))

找到my.ini,我的是在“G:/Program Files (x86)/MySQL/MySQL Server 5.0”目录下,

找到[mysqld],在下面添加:

log=存放日志的路径/my.log

我的配置值:

mysql通过查看跟踪日志跟踪执行的sql语句_MySQL 

保存文件,重启服务之后,在“G:/Program Files (x86)/MySQL/MySQL Server 5.0/data”目录下可以找到“mySQL.log”文件。

linux下的配置方法:

修改/etc/my.cnf,找到[mysqld],在下面添加:

log=存放日志的路径/my.log

修改完后,记得重启mysql服务哦。

bitsCN.com
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!