mysqlprocgrep man page

mysqlprocgrep — Search Server Process Lists


mysqlprocgrep [options]


This utility scans the process lists for the servers specified using instances of the --server option and selects those that match the conditions specified using the --age and --match-xxx options. For a process to match, all conditions given must match. The utility then either prints the selected processes (the default) or executes certain actions on them.

If no --age or --match-xxx options are given, the utility selects all processes.

The --match-xxx options correspond to the columns in the INFORMATION_SCHEMA.PROCESSLIST table. For example, --match-command specifies a matching condition for PROCESSLIST.COMMAND column values. There is no --match-time option. To specify a condition based on process time, use --age.

Processes that can be seen and killed are subject to whether the account used to connect to the server has the PROCESS and SUPER privileges. Without PROCESS, the account cannot see processes belonging to other accounts Without SUPER, the account cannot kill processes belonging to other accounts

To specify how to display output, use one of the following values with the --format option:

Options.PP mysqlprocgrep accepts the following command-line options:

NOTES.PP For the --format option, the permitted values are not case sensitive. In addition, values may be specified as any unambiguous prefix of a valid value. For example, --format=g specifies the grid format. An error occurs if a prefix matches more than one valid value.

The path to the MySQL client tools should be included in the PATH environment variable in order to use the authentication mechanism with login-paths. This will allow the utility to use the my_print_defaults tools which is required to read the login-path values from the login configuration file (.mylogin.cnf). EXAMPLES.PP For each example, assume that the root user on localhost has sufficient privileges to kill queries and connections.

Kill all queries created by user john that are less than 1 minute:

shell> mysqlprocgrep --server=root@localhost \
          --match-user=john --age=-1m --kill-query

Kill all connections that have been idle for more than 1 hour:

shell> mysqlprocgrep --server=root@localhost \
          --match-command=sleep --age=1h --kill-connection

PERMISSIONS REQUIRED.PP The user must have the SELECT privilege on the mysql database.

See Also

For more information, please refer to the MySQL Utilities and Fabric documentation, which is available online at


Oracle Corporation (


09/15/2015 MySQL 1.5.6 MySQL Utilities