开发使用的是测试服务器数据库, 想查看调用服务端接口实际执行的SQL情况,于是使用抓包工具Wireshark
来查看本机发出的SQL。
首先使用本地Mysql进行测试,
然后在Mysql会话终端执行了两条命令
select version();
select now();
wireshark中的输出为
发现并没有捕获发送上述两条命令的包。不知为何没有捕获到?
另外我看到有文章介绍使用Wireshark可以这样捕获Mysql语句
To filter out the mysql packets you just use the filter ‘mysql‘ or ‘mysql.query != “”‘ when you only want packets that request a query. After that you can add a custom column with the field name ‘mysql.query’ to have a list of queries that where executed.
效果如下
可见如果只是想看执行的sql的话非常方便。不知道怎样配置才能有这样的效果?