MySQL 8.0 Reference Manual Including MySQL NDB Cluster 8.0

6.5.7 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 15.7.7, “SHOW Statements”. 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:

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 6.2.2.2, “Using Option Files”.

Table 6.18 mysqlshow Options

Option Name Description Introduced Deprecated
--bind-address Use specified network interface to connect to MySQL Server
--character-sets-dir Directory where character sets can be found
--compress Compress all information sent between client and server 8.0.18
--compression-algorithms Permitted compression algorithms for connections to server 8.0.18
--count Show the number of rows per table
--debug Write debugging log
--debug-check Print debugging information when program exits
--debug-info Print debugging information, memory, and CPU statistics when program exits
--default-auth Authentication plugin to use
--default-character-set Specify default character set
--defaults-extra-file Read named option file in addition to usual option files
--defaults-file Read only named option file
--defaults-group-suffix Option group suffix value
--enable-cleartext-plugin Enable cleartext authentication plugin
--get-server-public-key Request RSA public key from server
--help Display help message and exit
--host Host on which MySQL server is located
--keys Show table indexes
--login-path Read login path options from .mylogin.cnf
--no-defaults Read no option files
--password Password to use when connecting to server
--password1 First multifactor authentication password to use when connecting to server 8.0.27
--password2 Second multifactor authentication password to use when connecting to server 8.0.27
--password3 Third multifactor authentication password to use when connecting to server 8.0.27
--pipe Connect to server using named pipe (Windows only)
--plugin-dir Directory where plugins are installed
--port TCP/IP port number for connection
--print-defaults Print default options
--protocol Transport protocol to use
--server-public-key-path Path name to file containing RSA public key
--shared-memory-base-name Shared-memory name for shared-memory connections (Windows only)
--show-table-type Show a column indicating the table type
--socket Unix socket file or Windows named pipe to use
--ssl-ca File that contains list of trusted SSL Certificate Authorities
--ssl-capath Directory that contains trusted SSL Certificate Authority certificate files
--ssl-cert File that contains X.509 certificate
--ssl-cipher Permissible ciphers for connection encryption
--ssl-crl File that contains certificate revocation lists
--ssl-crlpath Directory that contains certificate revocation-list files
--ssl-fips-mode Whether to enable FIPS mode on client side 8.0.34
--ssl-key File that contains X.509 key
--ssl-mode Desired security state of connection to server
--ssl-session-data File that contains SSL session data 8.0.29
--ssl-session-data-continue-on-failed-reuse Whether to establish connections if session reuse fails 8.0.29
--status Display extra information about each table
--tls-ciphersuites Permissible TLSv1.3 ciphersuites for encrypted connections 8.0.16
--tls-version Permissible TLS protocols for encrypted connections
--user MySQL user name to use when connecting to server
--verbose Verbose mode
--version Display version information and exit
--zstd-compression-level Compression level for connections to server that use zstd compression 8.0.18