mysql_tableinfo
mysql_tableinfooptionsnew_database[existing_database[existing_table]]
This utility creates a table containing information about existing tables in a database. You have to specify the database that will contain the newly created metadata tables, and the utility will create the database if it does not exist. If given the name of an existing database, it will use its metadata as its basis. If also given a table name, it will refer to its metadata.
The utility will create four tables in the database:
db, col, idx,
and tbl. This last table may be named
tbl_status instead. It uses the SHOW
COLUMNS, SHOW DATABASES, SHOW
INDEXES, SHOW TABLES, and SHOW
TABLE STATUS statements to get metadata information. The user
given must have the necessary privileges for these statements.
--clearThis option drops all four tables to be created by the utility if they exist, before creating new ones and populating them.
--clear-onlyThis option drops all four tables to be created by the utility if they exist, but doesn’t create new ones—the utility will exit when it’s finished deleting the tables.
--colThis option puts column metadata into the
col table.
--help, -?,
-IThis option displays help information about the utility.
--host=host,
-h hostThis option specifies the host on which to obtain metadata information and to create tables.
--idxThis option puts index metadata into the
idx table.
--password=password,
-p passwordThis option provides the password of the user logging into the server.
--port=port,
-P portThis option specifies the port on which to connect to the server. The default is 3306.
--prefix=stringThis option adds a prefix to the names of the tables that
the utility creates (e.g., metadata_db instead
of db).
--quiet, -qThis option suppresses all messages except for error messages.
--socket=filename,
-S filenameThis option provides the name of the server’s socket file.
--tbl-statusThis option takes metadata from the SHOW TABLE
STATUS statement instead of SHOW
TABLES. The result is more metadata but a slower
process.
--user=user,
-u userThis option provides the username for logging into the server.