Capturing data is a critical part of performing a query analysis, or even just to have an idea of what’s going on inside the database.
There are several known ways to achieve this. For example:
Enable the General Log
Use the Slow Log with long_query_time = 0
Capture packets that go to MySQL from the network stream using TCPDUMP