JavaScript Editor Source code editor     What Is Ajax 


Main Page

8.18. 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.5.4, “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:

JavaScript Editor Source code editor     What Is Ajax