如何在mysql命令窗口获取到程序正在执行的sql语句

步骤:

1.进入mysql的命令窗口;

2.运行use information_schema;

3.运行select * from PROCESSLIST where info is not null;(注:需要在程序执行某一操作的同时执行该语句

4.命令窗口会列出当前mysql所有线程的相关信息,包含mysql正在执行的语句(在INFO一栏)。

mysql> use information_schema;

mysql> select * from PROCESSLIST where info is not null;

posted @ 2016-03-17 11:41  helloworld0011  阅读(1163)  评论(0编辑  收藏  举报