'\" t
.\" Title: \fBmysqlmetagrep\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1
.\" Date: 08/01/2016
.\" Manual: MySQL Utilities
.\" Source: MySQL 1.6.3
.\" Language: English
.\"
.TH "\FBMYSQLMETAGREP\FR" "1" "08/01/2016" "MySQL 1\&.6\&.3" "MySQL Utilities"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
mysqlmetagrep \- Search Database Object Definitions
.SH "SYNOPSIS"
.HP \w'\fBmysqlmetagrep\ [\fR\fB\fIoptions\fR\fR\fB]\ [\fR\fB\fIpattern\fR\fR\fB\ |\ \fR\fB\fIserver\fR\fR\fB]\ \&.\&.\&.\fR\ 'u
\fBmysqlmetagrep [\fR\fB\fIoptions\fR\fR\fB] [\fR\fB\fIpattern\fR\fR\fB | \fR\fB\fIserver\fR\fR\fB] \&.\&.\&.\fR
.SH "DESCRIPTION"
.PP
This utility searches for objects matching a given pattern on all the servers specified using instances of the
\fB\-\-server\fR
option\&. It produces output that displays the matching objects\&. By default, the first non\-option argument is taken to be the pattern unless the
\fB\-\-pattern\fR
option is given\&. If the
\fB\-\-pattern\fR
option is given, then all non\-option arguments are treated as connection specifications\&.
.PP
Internally, the utility generates an SQL statement for searching the necessary tables in the
\fBINFORMATION_SCHEMA\fR
database on the designated servers, and then executes it before collecting the result and printing it as a table\&. Use the
\fB\-\-sql\fR
option to have
\fBmysqlmetagrep\fR
display the statement, rather than execute it\&. This can be useful if you want to feed the output of the statement to another application, such as the
\fBmysql\fR
client command\-line tool\&.
.PP
The MySQL server supports two forms of patterns when matching strings: SQL Simple Patterns (used with the
\fBLIKE\fR
operator) and POSIX Regular Expressions (used with the
\fBREGEXP\fR
operator)\&.
.PP
By default, the utility uses the
\fBLIKE\fR
operator to match the name (and optionally, the body) of objects\&. To use the
\fBREGEXP\fR
operator instead, use the
\fB\-\-regexp\fR
option\&.
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
.PP
Because the
\fBREGEXP\fR
operator does substring searching, it is necessary to anchor the expression to the beginning of the string if you want to match the beginning of the string\&.
.sp .5v
.RE
.PP
To specify how to display output, use one of the following values with the
\fB\-\-format\fR
option:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBgrid\fR
(default)
.sp
Display output in grid or table format like that of the
\fBmysql\fR
client command\-line tool\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBcsv\fR
.sp
Display output in comma\-separated values format\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBtab\fR
.sp
Display output in tab\-separated format\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBvertical\fR
.sp
Display output in single\-column format like that of the
\eG
command for the
\fBmysql\fR
client command\-line tool\&.
.RE
SQL Simple Patterns.PP
The simple patterns defined by the SQL standard consist of a string of characters with two characters that have special meaning:
%
(percent) matches zero or more characters, and
_
(underscore) matches exactly one character\&.
.PP
For example:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\*(Aqjohn%\*(Aq
.sp
Match any string that starts with \*(Aqjohn\*(Aq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\*(Aq%doe%\*(Aq
.sp
Match any string containing the word \*(Aqdoe\*(Aq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\*(Aq%_\*(Aq
.sp
Match any string consisting of one or more characters\&.
.RE
POSIX Regular Expressions.PP
POSIX regular expressions are more powerful than the simple patterns defined in the SQL standard\&. A regular expression is a string of characters, optionally containing characters with special meaning\&.
.PP
Documenting these regular expressions goes beyond the scope of this manual, but the full syntax is described in the
\m[blue]\fBMySQL manual\fR\m[]\&\s-2\u[1]\d\s+2
and other locations, such as executing \*(Aqman regex\*(Aq in your terminal\&.
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\&.\fR
.sp
Match any character\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB^\fR
.sp
Match the beginning of a string\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB$\fR
.sp
Match the end of a string\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB[axy]\fR
.sp
Match
\fBa\fR,
\fBx\fR, or
\fBy\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB[a\-f]\fR
.sp
Match any character in the range
\fBa\fR
to
\fBf\fR
(that is,
\fBa\fR,
\fBb\fR,
\fBc\fR,
\fBd\fR,
\fBe\fR, or
\fBf\fR)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB[^axy]\fR
.sp
Match any character
\fIexcept\fR
\fBa\fR,
\fBx\fR, or
\fBy\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBa*\fR
.sp
Match a sequence of zero or more
\fBa\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBa+\fR
.sp
Match a sequence of one or more
\fBa\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBa?\fR
.sp
Match zero or one
\fBa\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBab|cd\fR
.sp
Match
\fBab\fR
or
\fBcd\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBa{5}\fR
.sp
Match five instances of
\fBa\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBa{2,5}\fR
.sp
Match from two to five instances of
\fBa\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB(abc)+\fR
.sp
Match one or more repetitions of
\fBabc\fR\&.
.RE
OPTIONS.PP
\fBmysqlmetagrep\fR
accepts the following command\-line options:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-help
.sp
Display a help message and exit\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-license
.sp
Display license information and exit\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-body, \-b
.sp
Search the body of stored programs (procedures, functions, triggers, and events)\&. The default is to match only the name\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-character\-set=
.sp
Sets the client character set\&. The default is retrieved from the server variable
character_set_client\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-database=
.sp
Look only in databases matching this pattern\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-format=, \-f
.sp
Specify the output display format\&. Permitted format values are
\fBgrid\fR
(default),
\fBcsv\fR,
\fBtab\fR, and
\fBvertical\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-object\-types=, \-\-search\-objects=
.sp
Search only the object types named in
\fItypes\fR, which is a comma\-separated list of one or more of the values
\fBdatabase\fR,
\fBtrigger\fR,
\fBuser\fR,
\fBroutine\fR,
\fBcolumn\fR,
\fBtable\fR,
\fBpartition\fR,
\fBevent\fR
and
\fBview\fR\&.
.sp
The default is to search in objects of all types\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-pattern=, \-e=
.sp
The pattern to use when matching\&. This is required when the first non\-option argument looks like a connection specification rather than a pattern\&.
.sp
If the
\fB\-\-pattern\fR
option is given, the first non\-option argument is treated as a connection specifier, not as a pattern\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-regexp, \-\-basic\-regexp, \-G
.sp
Perform pattern matches using the
\fBREGEXP\fR
operator\&. The default is to use
\fBLIKE\fR
for matching\&. This affects the
\fB\-\-database\fR
and
\fB\-\-pattern\fR
options\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-server=