Download MySQL Utilities - Oracle Documentation

Transcript
PERMISSIONS REQUIRED
+------------------------+--------------+--------------+-----------+
To find all object that contain 't2' in the name or the body (for routines, triggers, and events):
shell> mysqlmetagrep -b --pattern="%t2%" --server=john@localhost:3306
+------------------------+--------------+--------------+-----------+
| Connection
| Object Type | Object Name | Database |
+------------------------+--------------+--------------+-----------+
| john:*@localhost:3306 | TRIGGER
| tr_foo
| test
|
| john:*@localhost:3306 | TABLE
| t2
| test
|
+------------------------+--------------+--------------+-----------+
In the preceding output, the trigger name does not match the pattern, but is displayed because its body
does.
This is the same as the previous example, but using the REGEXP operator. Note that in the pattern it is not
necessary to add wildcards before or after t2:
shell> mysqlmetagrep -Gb --pattern="t2" --server=john@localhost
+------------------------+--------------+--------------+-----------+
| Connection
| Object Type | Object Name | Database |
+------------------------+--------------+--------------+-----------+
| root:*@localhost:3306 | TRIGGER
| tr_foo
| test
|
| root:*@localhost:3306 | TABLE
| t2
| test
|
+------------------------+--------------+--------------+-----------+
PERMISSIONS REQUIRED
The user must have the SELECT privilege on the mysql database.
5.17 mysqlprocgrep — Search Server Process Lists
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.
When the --kill-query or --kill-connection option is used, the utility will display those rows from
the SHOW PROCESSLIST that match the query and are killed. This behavior exists as of MySQL Utilities
1.6.0.
To specify how to display output, use one of the following values with the --format option:
• grid (default)
Display output in grid or table format like that of the mysql client command-line tool.
158