File: mysql_tableinfo.1

package info (click to toggle)
mysql-dfsg-5.0 5.0.51a-24%2Blenny5
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 106,168 kB
  • ctags: 94,516
  • sloc: cpp: 447,179; ansic: 411,410; perl: 38,307; sh: 37,449; tcl: 30,484; pascal: 14,851; yacc: 8,559; makefile: 5,078; java: 4,610; xml: 3,953; sql: 2,920; awk: 1,338; asm: 1,061; sed: 772
file content (344 lines) | stat: -rw-r--r-- 6,521 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
.\"     Title: \fBmysql_tableinfo\fR
.\"    Author: 
.\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
.\"      Date: 01/11/2008
.\"    Manual: MySQL Database System
.\"    Source: MySQL 5.0
.\"
.TH "\fBMYSQL_TABLEINFO\\F" "1" "01/11/2008" "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, INFORMATION_SCHEMA Tables.
.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:
.PP
.B Table\ 4.12.\ \fBmysql_tableinfo\fR Option Reference
.sp -1n
.TS
allbox tab(:);
lB lB lB lB.
T{
\fBFormat\fR
T}:T{
\fBConfig File\fR
T}:T{
\fBDescription\fR
T}:T{
\fBIntroduced\fR
T}
.T&
l l l l
l l l l
l l l l
l l l l
l l l l
l l l l
l l l l
l l l l
l l l l
l l l l
l l l l
l l l l
l l ^ l
l l l l.
T{
\-\-clear
T}:T{
clear
T}:T{
Before populating each metadata table, drop it if it exists
T}:T{
\ 
T}
T{
\-\-prefix=prefix_str
T}:T{
prefix
T}:T{
Add prefix_str at the beginning of each metadata table name
T}:T{
\ 
T}
T{
\-\-quiet
T}:T{
quiet
T}:T{
Be silent except for errors
T}:T{
\ 
T}
T{
\-\-socket=path
T}:T{
socket
T}:T{
Display version information and exit
T}:T{
\ 
T}
T{
\-\-tbl\-status
T}:T{
tbl\-status
T}:T{
Use SHOW TABLE STATUS instead of SHOW TABLES
T}:T{
\ 
T}
T{
\-\-user=user_name,
T}:T{
user
T}:T{
The mysql_tableinfo username to use when connecting to the server
T}:T{
\ 
T}
T{
\-\-clear\-only
T}:T{
clear\-only
T}:T{
Similar to \-\-clear, but exits after dropping the metadata tables  to be populated.
T}:T{
\ 
T}
T{
\-\-col
T}:T{
col
T}:T{
Generate column metadata into the col table
T}:T{
\ 
T}
T{
\-\-help
T}:T{
\ 
T}:T{
Display help message and exit
T}:T{
\ 
T}
T{
\-\-host=host_name
T}:T{
host
T}:T{
Connect to the MySQL server on the given host
T}:T{
\ 
T}
T{
\-\-idx
T}:T{
idx
T}:T{
Generate index metadata into the idx table
T}:T{
\ 
T}
T{
\-\-password=password
T}:T{
password
T}:T{
The password to use when connecting to the server \-\- not optional
T}:T{
\ 
T}
T{
\-ppassword
T}:T{
\ 
T}::T{
\ 
T}
T{
\-\-port=port_num
T}:T{
port
T}:T{
The TCP/IP port number to use for the connection
T}:T{
\ 
T}
.TE
.sp
.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\ 5.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 2007\-2008 MySQL AB
.PP
This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110\-1301 USA or see http://www.gnu.org/licenses/.
.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/).