![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is there any way to view the last SQL that was run on a connection for which "show processlist" shows the command status as "Sleep"? I suspect that answer is no, but the reason for asking is that I have a couple of connections which are being left open with no activity and I'm sure that this is because the application I'm developing has opened two connections which have not then been closed. (I'm not otherwise leaking connections.) Since I've not yet identified any holes in the appliation logic (although they must be there) I was wondering whether I could see what the connection was last used for as that would give me a clue as to where in the application code to look. |
#3
| |||
| |||
|
|
Is there any way to view the last SQL that was run on a connection for which "show processlist" shows the command status as "Sleep"? |
|
I suspect that answer is no |

|
but the reason for asking is that I have a couple of connections which are being left open with no activity and I'm sure that this is because the application I'm developing has opened two connections which have not then been closed. (I'm not otherwise leaking connections.) Since I've not yet identified any holes in the appliation logic (although they must be there) I was wondering whether I could see what the connection was last used for as that would give me a clue as to where in the application code to look. |
#4
| |||
| |||
|
|
"Brian Cryer" <not.here (AT) localhost (DOT) invalid> wrote: Is there any way to view the last SQL that was run on a connection for which "show processlist" shows the command status as "Sleep"? snip Finally you can turn on the general query log, which will record the complete history of all operations in all connections: http://dev.mysql.com/doc/refman/5.1/en/query-log.html |
![]() |
| Thread Tools | |
| Display Modes | |
| |