MySQL queries coming on TCP instead of MySQL Protocol

夙愿已清 提交于 2019-12-12 01:39:46

问题


I'm trying to capture MySQL activities through my web application and MySQL Server by using Wireshark on Windows. I've seen that most of questions about capturing packets related to MySQL return MySQL Protocol and the possibility of seeing the queries sent and their responses. Yet, when running Wireshark and using my application, I see only TCP packets coming and going, as can be seen in the pictures in the links below.

TCP Packet -> Src - Dst

Inside TCP Packet

It's important to note that I've used tools like tshark and WinDump to collect packets through the network, but nothing worked.

Am I doing something wrong or it's a Wireshark bug?


Thanks for the answers! I did what was suggested by Christopher following Edit -> Preferences -> Protocols -> MySQL. There was nothing like "Port Number", but the issue was that "Show SQL Query string in INFO column" was not selected.


回答1:


The image provided indicates that the port in use is 3307, but the MySQL dissector registers by default on port 3306, which is the IANA-registered port for mysql traffic. So, when a non-standard port is used, you must make use of the "Decode As" feature of Wireshark, as nnovich-OK has already mentioned.

Another option in many cases, which unfortunately is not yet available in this case, is to change the port number that the dissector registers for. The MySQL dissector does not offer a port preference though, but you could open a Wireshark bug report asking for such a preference to be added - even better if you submit a patch that actually implements it. Once a preference is available, then you could set it as desired via Edit -> Preferences -> Protocols -> MySQL -> Port Number, similar to how many other dissectors allow a configurable port.




回答2:


Wireshark has some logic which automatically determines type of traffic observed. I don't know the reason for it to fail in your case, but you can always manually point to the desired protocol. Right click on one of your TCP packets, click on "decode as" and choose "MySQL" in the last column.



来源:https://stackoverflow.com/questions/43188560/mysql-queries-coming-on-tcp-instead-of-mysql-protocol

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!