Home > Database > Mysql Tutorial > mysql如何跟踪执行的sql语句_MySQL

mysql如何跟踪执行的sql语句_MySQL

不言
Release: 2018-05-16 10:04:41
Original
1541 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

我的配置值:

保存文件,重启服务之后,在“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