Guy
Guy

Reputation: 14840

How to view current running queries on a DB

I'm using Sqlyog to run queries on a db.

Is there a way to view the all the current running queries on the db (and possibly kill some of them)? If not, what is a recommended tool for this purpose?

Upvotes: 1

Views: 2784

Answers (3)

Ben Gribaudo
Ben Gribaudo

Reputation: 5147

You can also get this information by executing the MySQL command SHOW PROCESSLIST or by querying the INFORMATION_SCHEMA.PROCESSLIST table.

Both of these approaches can be used by humans or code to get process list info. You can even do things like:

SELECT Time FROM INFORMATION_SCHEMA.PROCESSLIST WHERE User = '...' (etc.)

Upvotes: 1

Randy
Randy

Reputation: 4023

SHOW PROCESSLIST and then KILL [process number].

Upvotes: 2

wezzy
wezzy

Reputation: 5935

try installing the free Mysql Administrator. It has a tab where it lists all the queries running on the server. Probably you can do the same with the command line tools but i think that the administrator is more user friendly.

Upvotes: 0

Related Questions