2
3
4
6 mysql_tableinfo - generate database metadata
7
9 mysql_tableinfo [options] db_name [db_like [tbl_like]]
10
12 mysql_tableinfo creates tables and populates them with database
13 metadata. It uses SHOW DATABASES, SHOW TABLES, SHOW TABLE STATUS, SHOW
14 COLUMNS, and SHOW INDEX to obtain the metadata.
15
16 In MySQL 5.0 and up, the INFORMATION_SCHEMA database contains the same
17 kind of information in the SCHEMATA, TABLES, COLUMNS, and STATISTICS
18 tables. See Chapter 20, The INFORMATION_SCHEMA Database.
19
20 Invoke mysql_tableinfo like this:
21
22 shell> mysql_tableinfo [options] db_name [db_like [tbl_like]]
23
24 The db_name argument indicates which database mysql_tableinfo should
25 use as the location for the metadata tables. The database will be
26 created if it does not exist. The tables will be named db, tbl (or
27 tbl_status), col, and idx.
28
29 If the db_like or tbl_like arguments are given, they are used as
30 patterns and metadata is generated only for databases or tables that
31 match the patterns. These arguments default to % if not given.
32
33 Examples:
34
35 mysql_tableinfo info
36 mysql_tableinfo info world
37 mysql_tableinfo info mydb tmp%
38
39 Each of the commands stores information into tables in the info
40 database. The first stores information for all databases and tables.
41 The second stores information for all tables in the world database. The
42 third stores information for tables in the mydb database that have
43 names matching the pattern tmp%.
44
45 mysql_tableinfo supports the following options:
46
47 · --help
48
49 Display a help message and exit.
50
51 · --clear
52
53 Before populating each metadata table, drop it if it exists.
54
55 · --clear-only
56
57 Similar to --clear, but exits after dropping the metadata tables to
58 be populated.
59
60 · --col
61
62 Generate column metadata into the col table.
63
64 · --host=host_name, -h host_name
65
66 Connect to the MySQL server on the given host.
67
68 · --idx
69
70 Generate index metadata into the idx table.
71
72 · --password=password, -ppassword
73
74 The password to use when connecting to the server. Note that the
75 password value is not optional for this option, unlike for other
76 MySQL programs. You can use an option file to avoid giving the
77 password on the command line.
78
79 Specifying a password on the command line should be considered
80 insecure. See Section 6.6, “Keeping Your Password Secure”.
81
82 · --port=port_num, -P port_num
83
84 The TCP/IP port number to use for the connection.
85
86 · --prefix=prefix_str
87
88 Add prefix_str at the beginning of each metadata table name.
89
90 · --quiet, -q
91
92 Be silent except for errors.
93
94 · --socket=path, -S path
95
96 The Unix socket file to use for the connection.
97
98 · --tbl-status
99
100 Use SHOW TABLE STATUS instead of SHOW TABLES. This provides more
101 complete information, but is slower.
102
103 · --user=user_name, -u user_name
104
105 The MySQL username to use when connecting to the server.
106
108 Copyright 1997-2007 MySQL AB
109
110 This documentation is NOT distributed under a GPL license. Use of this
111 documentation is subject to the following terms: You may create a
112 printed copy of this documentation solely for your own personal use.
113 Conversion to other formats is allowed as long as the actual content is
114 not altered or edited in any way. You shall not publish or distribute
115 this documentation in any form or on any media, except if you
116 distribute the documentation in a manner similar to how MySQL
117 disseminates it (that is, electronically for download on a Web site
118 with the software) or on a CD-ROM or similar medium, provided however
119 that the documentation is disseminated together with the software on
120 the same medium. Any other use, such as any dissemination of printed
121 copies or use of this documentation, in whole or in part, in another
122 publication, requires the prior written consent from an authorized
123 representative of MySQL AB. MySQL AB reserves any and all rights to
124 this documentation not expressly granted above.
125
126 Please email <docs@mysql.com> for more information.
127
129 For more information, please refer to the MySQL Reference Manual, which
130 may already be installed locally and which is also available online at
131 http://dev.mysql.com/doc/.
132
134 MySQL AB (http://www.mysql.com/). This software comes with no
135 warranty.
136
137
138