How to find out which script is running a MySQL query?
So I need to fix a query in a large application that I'm not familiar with. The application 开发者_如何学JAVAis live, and the issue is urgent. The query is killing our server. I found the query that is causing the issue, and I know how to fix it. I found it in phpMyAdmin's status or SHOW processlist
. But I don't know which script is actually running it. The application is built in .NET, ASP.
Ideally the application is using a specific username(s) that could be used to trace that it is the cause of the delay. Sometimes large queries in MySQL need to be refactored using better indexes or broken into smaller steps that involve temporary table creation and then querying of the temporary tables.
精彩评论