4.5.6 mysqlshow — Display Database, Table, and Column Information

The mysqlshow client can be used to quickly see which databases exist, their tables, or a table's columns or indexes.

mysqlshow provides a command-line interface to several SQL SHOW statements. See Section 13.7.5, “SHOW Syntax”. The same information can be obtained by using those statements directly. For example, you can issue them from the mysql client program.

Invoke mysqlshow like this:

shell> mysqlshow [options] [db_name [tbl_name [col_name]]]

The output displays only the names of those databases, tables, or columns for which you have some privileges.

If the last argument contains shell or SQL wildcard characters (*, ?, %, or _), only those names that are matched by the wildcard are shown. If a database name contains any underscores, those should be escaped with a backslash (some Unix shells require two) to get a list of the proper tables or columns. * and ? characters are converted into SQL % and _ wildcard characters. This might cause some confusion when you try to display the columns for a table with a _ in the name, because in this case, mysqlshow shows you only the table names that match the pattern. This is easily fixed by adding an extra % last on the command line as a separate argument.

mysqlshow supports the following options, which can be specified on the command line or in the [mysqlshow] and [client] groups of an option file. For information about option files used by MySQL programs, see Section 4.2.6, “Using Option Files”.

Table 4.10 mysqlshow Options

FormatDescriptionIntroduced
--bind-address=ip_addressUse specified network interface to connect to MySQL Server 
--compressCompress all information sent between client and server 
--countShow the number of rows per table 
--debug[=debug_options]Write a debugging log 
--debug-checkPrint debugging information when program exits 
--debug-infoPrint debugging information, memory, and CPU statistics when program exits 
--default-auth=pluginAuthentication plugin to use5.6.2
--default-character-set=charset_nameSpecify default character set 
--defaults-extra-file=file_nameRead option file in addition to usual option files 
--defaults-file=file_nameRead only named option file 
--defaults-group-suffix=strOption group suffix value 
--helpDisplay help message and exit 
--host=host_nameConnect to MySQL server on given host 
--keysShow table indexes 
--login-path=nameRead login path options from .mylogin.cnf5.6.6
--no-defaultsRead no option files 
--password[=password]Password to use when connecting to server 
--pipeOn Windows, connect to server using named pipe 
--plugin-dir=pathDirectory where plugins are installed5.6.2
--port=port_numTCP/IP port number to use for connection 
--print-defaultsPrint defaults 
--protocol=typeConnection protocol to use 
--secure-authDo not send passwords to the server in old (pre-4.1.1) format5.6.17
--shared-memory-base-name=nameThe name of shared memory to use for shared-memory connections 
--show-table-typeShow a column indicating the table type 
--socket=pathFor connections to localhost, the Unix socket file to use 
--sslEnable SSL for connection 
--ssl-ca=file_namePath of file that contains list of trusted SSL CAs 
--ssl-capath=dir_namePath of directory that contains trusted SSL CA certificates in PEM format 
--ssl-cert=file_namePath of file that contains X509 certificate in PEM format 
--ssl-cipher=cipher_listList of permitted ciphers to use for SSL encryption 
--ssl-crl=file_namePath of file that contains certificate revocation lists5.6.3
--ssl-crlpath=dir_namePath of directory that contains certificate revocation list files5.6.3
--ssl-key=file_namePath of file that contains X509 key in PEM format 
--ssl-verify-server-certVerify server Common Name value in its certificate against host name used when connecting to server 
--statusDisplay extra information about each table 
--user=user_name,MySQL user name to use when connecting to server 
--verboseVerbose mode 
--versionDisplay version information and exit