What is the MySQL equivalent statement of DBCC INPUTBUFFER(@@SPID)
, which lists the sql statement for current connection or specified connection?
views:
209answers:
1
+3
A:
Use SHOW PROFILES to see a list of the most recent statements sent to MySQL:
SHOW PROFILES;
If you want/need to see currently running queries, use SHOW PROCESSLIST:
SHOW FULL PROCESSLIST;
The FULL
keyword means the list will include queries from all clients, not just the one you are running the command on.
OMG Ponies
2009-12-21 09:23:41
beacuse i want sql statement for audot purpose.if i can get it from trigger then i will be fine.
Paresh
2009-12-21 09:48:47
The FULL keyword means the list will include queries from all clients, not just the one you are running the command on.----- So how can we get for only current process?
Paresh
2009-12-21 09:49:32
What do you mean by "current process"? If the query has finished executing, use `SHOW PROFILES`. If it is still running, use `SHOW PROCESSLIST`. There are links to the documentation.
OMG Ponies
2009-12-21 10:04:04
Thanks BuddyRegards,paresh (paresh-sqldba.blogspot.com)
Paresh
2009-12-28 11:05:13