Home  >  Article  >  Database  >  跟踪监控MYSQL执行的sql语句

跟踪监控MYSQL执行的sql语句

WBOY
WBOYOriginal
2016-06-07 15:27:421444browse

一windows平台下为例: 修改my.ini,在mysqld下添加log一行, [mysqld] log = D:/tmp/mysql_log/mysql_log.sql 然后,重新启动mysql,就可以实时看到myql服务器当前正在执行的语句了。 ================ 监控mysql执行的sql语句为了做好配合

一windows平台下为例:

修改my.ini,在mysqld下添加log一行,

[mysqld]
log = "D:/tmp/mysql_log/mysql_log.sql"

然后,重新启动mysql,就可以实时看到myql服务器当前正在执行的语句了。

 

================

监控mysql执行的sql语句 为了做好配合开发做性能和功能测试,方便监控正在执行的sql语句,

可以在/etc/mysqld中添加如下:
 log =/usr/local/mysql/var21005/mysql.log就可以使用:tail -f mysql.log来监控了  www.2cto.com   如果需要监控慢查询可以添加如下内容:
 log-slow-queries = /usr/local/mysql/var21005/slowquery.loglong_query_time = 1 
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