June 20, 2019

mysqlmetagrep utility commands in MySQL database

MySQL utility - mysqlmetagrep

mysqlmetagrep     search metadata/Database Object Definitions   

MySQL mysqlmetagrep utility searches for objects matching a given pattern on all the servers specified using instances mentioned in command line. And displays the matching objects.

Usage: mysqlmetagrep --server=user:pass@host:port:socket [options] pattern

mysqlmetagrep --help
mysqlmetagrep --version

mysqlmetagrep --pattern="CountryCode" --server=root:secret@localhost
mysqlmetagrep --pattern="t_" --server=dba

mysqlmetagrep -b --pattern="%t2%" --server=test@localhost:3308
mysqlmetagrep -Gb --pattern="t2" --server=mysql_dba

mysqlmetagrep --server=root:secret@localhost --pattern=host --search=column
mysqlmetagrep --server=root:secret@localhost:3310 --pattern='innodb%' --format=vertical

mysqlmetagrep --server=dba -e '%memory%thread%' --database=sys --search-objects=view -f vertical

mysqlmetagrep Options:
  --version             show program's version number and exit
  --help                 display a help message and exit
  --license             display program's license and exit
  --server=SERVER       connection information for the server in the form: user[:password]@host[:port][:socket] or login-path[:port][:socket] or config-path[[group]].

  --ssl-ca=SSL_CA         path to a file that contains a list of trusted SSL     CAs.
  --ssl-cert=SSL_CERT   name of the SSL certificate file to use for    establishing a secure connection.
  --ssl-key=SSL_KEY     name of the SSL key file to use for establishing a  secure connection.
  --ssl=SSL             specifies if the server connection requires use of  SSL. If an encrypted connection cannot be established, the connection attempt fails. By default 0 (SSL not required).

  --character-set=CHARSET  sets the client character set. The default is  retrieved from the server variable  'character_set_client'.
  -b, --body            search the body of routines, triggers, and events as   well
  --search-objects=OBJECT_TYPES, --object-types=OBJECT_TYPES   the object type to search in: a comma-separated list of one or more of: 'database', 'trigger', 'user', 'routine', 'column', 'table', 'partition', 'event', 'view'
  -G, --basic-regexp, --regexp   use 'REGEXP' operator to match pattern. Default is to  use 'LIKE'.

  -p, --print-sql, --sql     print the statement instead of sending it to the   server
  -e PATTERN, --pattern=PATTERN   pattern to use when matching. Required if the pattern  looks like a connection specification.
  --database=DATABASE_PATTERN  only look at objects in databases matching this  pattern
  -f FORMAT, --format=FORMAT  display the output in either grid (default), tab, csv,  or vertical format


Related MySQL Articles: mysqlprocgrep utility commands in MySQL

No comments:

Post a Comment