Display MySQL Database, Table, and Column Information

MySQLMySQLi Database

The mysqlshow client can be used to see what databases exist, their tables, or a table's columns or indexes.It provides a command-line interface for several SQL SHOW statements.

Invoke mysqlshow

The mysqlshow utility can be invoked as shown below −

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

Here,

  • If no database is provided, a list of database names are displayed.

  • If no table is given, all matching tables in the database are displayed.

  • If no column is provided, all matching columns and column types in the table are shown.

  • The output displays the names of only those databases, tables, or columns for which the user has certain privileges.

Options

mysqlshow supports the below options. These can be specified on the command line or in the [mysqlshow] and [client] groups of an option file.

--bind-address=ip_address

If a computer has multiple network interfaces, this option can be used to select which interface has to be used to connect to the MySQL server.

--character-sets-dir=dir_name

It is the directory where character sets are installed.

--compress, -C

It compresses all information that is sent between the client and the server if possible.

--count

It will show the number of rows per table. This can be slow for non-MyISAM tables.

--port=port_num, -P port_num

It is for TCP/IP connections, it tells about the port number to use.

--print-defaults

It prints the program name and all options that it gets from option files.

--user=user_name, -u user_name

It is the user name of the MySQL account that is used to connect to the server.

--verbose, -v

It is the verbose mode. It prints more information about what the program does. This option can be used multiple times to increase the amount of information.

--version, -V

It displays the version information and exits.

raja
Published on 10-Mar-2021 13:04:27
Advertisements