.\" Title: \fBmysql_tableinfo\fR
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.70.1
.\" Date: 05/02/2007
.\" Manual: MySQL Database System
.\" Source: MySQL 5.0
.\"
.TH "\fBMYSQL_TABLEINFO\\F" "1" "05/02/2007" "MySQL 5.0" "MySQL Database System"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
mysql_tableinfo \- generate database metadata
.SH "SYNOPSIS"
.HP 55
\fBmysql_tableinfo [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIdb_name\fR\fR\fB [\fR\fB\fIdb_like\fR\fR\fB [\fR\fB\fItbl_like\fR\fR\fB]]\fR
.SH "DESCRIPTION"
.PP
\fBmysql_tableinfo\fR
creates tables and populates them with database metadata. It uses
SHOW DATABASES,
SHOW TABLES,
SHOW TABLE STATUS,
SHOW COLUMNS, and
SHOW INDEX
to obtain the metadata.
.PP
In MySQL 5.0 and up, the
INFORMATION_SCHEMA
database contains the same kind of information in the
SCHEMATA,
TABLES,
COLUMNS, and
STATISTICS
tables. See
Chapter\ 20, The INFORMATION_SCHEMA Database.
.PP
Invoke
\fBmysql_tableinfo\fR
like this:
.sp
.RS 3n
.nf
shell> \fBmysql_tableinfo [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIdb_name\fR\fR\fB [\fR\fB\fIdb_like\fR\fR\fB [\fR\fB\fItbl_like\fR\fR\fB]]\fR
.fi
.RE
.PP
The
\fIdb_name\fR
argument indicates which database
\fBmysql_tableinfo\fR
should use as the location for the metadata tables. The database will be created if it does not exist. The tables will be named
db,
tbl
(or
tbl_status),
col, and
idx.
.PP
If the
\fIdb_like\fR
or
\fItbl_like\fR
arguments are given, they are used as patterns and metadata is generated only for databases or tables that match the patterns. These arguments default to
%
if not given.
.PP
Examples:
.sp
.RS 3n
.nf
mysql_tableinfo info
mysql_tableinfo info world
mysql_tableinfo info mydb tmp%
.fi
.RE
.PP
Each of the commands stores information into tables in the
info
database. The first stores information for all databases and tables. The second stores information for all tables in the
world
database. The third stores information for tables in the
mydb
database that have names matching the pattern
tmp%.
.PP
\fBmysql_tableinfo\fR
supports the following options:
.TP 3n
\(bu
\fB\-\-help\fR
.sp
Display a help message and exit.
.TP 3n
\(bu
\fB\-\-clear\fR
.sp
Before populating each metadata table, drop it if it exists.
.TP 3n
\(bu
\fB\-\-clear\-only\fR
.sp
Similar to
\fB\-\-clear\fR, but exits after dropping the metadata tables to be populated.
.TP 3n
\(bu
\fB\-\-col\fR
.sp
Generate column metadata into the
col
table.
.TP 3n
\(bu
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
Connect to the MySQL server on the given host.
.TP 3n
\(bu
\fB\-\-idx\fR
.sp
Generate index metadata into the
idx
table.
.TP 3n
\(bu
\fB\-\-password=\fR\fB\fIpassword\fR\fR,
\fB\-p\fR\fB\fIpassword\fR\fR
.sp
The password to use when connecting to the server. Note that the password value is not optional for this option, unlike for other MySQL programs. You can use an option file to avoid giving the password on the command line.
.sp
Specifying a password on the command line should be considered insecure. See
Section\ 6.6, \(lqKeeping Your Password Secure\(rq.
.TP 3n
\(bu
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
The TCP/IP port number to use for the connection.
.TP 3n
\(bu
\fB\-\-prefix=\fR\fB\fIprefix_str\fR\fR
.sp
Add
\fIprefix_str\fR
at the beginning of each metadata table name.
.TP 3n
\(bu
\fB\-\-quiet\fR,
\fB\-q\fR
.sp
Be silent except for errors.
.TP 3n
\(bu
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
The Unix socket file to use for the connection.
.TP 3n
\(bu
\fB\-\-tbl\-status\fR
.sp
Use
SHOW TABLE STATUS
instead of
SHOW TABLES. This provides more complete information, but is slower.
.TP 3n
\(bu
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
The MySQL username to use when connecting to the server.
.SH "COPYRIGHT"
.PP
Copyright 1997\-2007 MySQL AB
.PP
This documentation is NOT distributed under a GPL license. Use of this documentation is subject to the following terms: You may create a printed copy of this documentation solely for your own personal use. Conversion to other formats is allowed as long as the actual content is not altered or edited in any way. You shall not publish or distribute this documentation in any form or on any media, except if you distribute the documentation in a manner similar to how MySQL disseminates it (that is, electronically for download on a Web site with the software) or on a CD\-ROM or similar medium, provided however that the documentation is disseminated together with the software on the same medium. Any other use, such as any dissemination of printed copies or use of this documentation, in whole or in part, in another publication, requires the prior written consent from an authorized representative of MySQL AB. MySQL AB reserves any and all rights to this documentation not expressly granted above.
.PP
Please email
for more information.
.SH "SEE ALSO"
For more information, please refer to the MySQL Reference Manual,
which may already be installed locally and which is also available
online at http://dev.mysql.com/doc/.
.SH AUTHOR
MySQL AB (http://www.mysql.com/).
This software comes with no warranty.