I have a MySQL transaction id, and a lovely MySQL console. Is there a way, from this, to get a list of the queries that have been run in that transaction?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m assuming by “transaction id” you mean “thread id”.
This is only possible if you enable the general query log. That logs every query run on the server. It adds enough overhead that most people do not use it in production. However if you do happen to use
general_log = 'ON'andlog_output = 'TABLE'in your environment then you can look at the query history for a given thread id like this:The ids eventually roll over, so you should probably limit your query to an appropriate time wondow (the past hour, past day, etc.) For example to limit it to the past day: