~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzlecheck.1

  • Committer: Monty Taylor
  • Date: 2009-07-27 17:30:05 UTC
  • mto: (1093.7.1 captain)
  • mto: This revision was merged to the branch mainline in revision 1101.
  • Revision ID: mordred@inaugust.com-20090727173005-ohhbhnifbo1qh3hw
Removed drizzlecheck program and the myisamcheck test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.\"     Title: \fBmysqlcheck\fR
2
 
.\"    Author: 
3
 
.\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
4
 
.\"      Date: 05/23/2009
5
 
.\"    Manual: MySQL Database System
6
 
.\"    Source: MySQL 6.0
7
 
.\"
8
 
.TH "\fBMYSQLCHECK\fR" "1" "05/23/2009" "MySQL 6.0" "MySQL Database System"
9
 
.\" disable hyphenation
10
 
.nh
11
 
.\" disable justification (adjust text to left margin only)
12
 
.ad l
13
 
.SH "NAME"
14
 
mysqlcheck \- a table maintenance program
15
 
.SH "SYNOPSIS"
16
 
.HP 46
17
 
\fBmysqlcheck [\fR\fB\fIoptions\fR\fR\fB] [\fR\fB\fIdb_name\fR\fR\fB [\fR\fB\fItbl_name\fR\fR\fB ...]]\fR
18
 
.SH "DESCRIPTION"
19
 
.PP
20
 
The
21
 
\fBmysqlcheck\fR
22
 
client performs table maintenance: It checks, repairs, optimizes, or analyzes tables.
23
 
.PP
24
 
Each table is locked and therefore unavailable to other sessions while it is being processed. Table maintenance operations can be time\-consuming, particularly for large tables. If you use the
25
 
\fB\-\-databases\fR
26
 
or
27
 
\fB\-\-all\-databases\fR
28
 
option to process all tables in one or more databases, an invocation of
29
 
\fBmysqlcheck\fR
30
 
might take a long time. (This is also true for
31
 
\fBmysql_upgrade\fR
32
 
because that program invokes
33
 
\fBmysqlcheck\fR
34
 
to check all tables and repair them if necessary.)
35
 
.PP
36
 
\fBmysqlcheck\fR
37
 
is similar in function to
38
 
\fBmyisamchk\fR, but works differently. The main operational difference is that
39
 
\fBmysqlcheck\fR
40
 
must be used when the
41
 
\fBmysqld\fR
42
 
server is running, whereas
43
 
\fBmyisamchk\fR
44
 
should be used when it is not. The benefit of using
45
 
\fBmysqlcheck\fR
46
 
is that you do not have to stop the server to perform table maintenance.
47
 
.PP
48
 
\fBmysqlcheck\fR
49
 
uses the SQL statements
50
 
CHECK TABLE,
51
 
REPAIR TABLE,
52
 
ANALYZE TABLE, and
53
 
OPTIMIZE TABLE
54
 
in a convenient way for the user. It determines which statements to use for the operation you want to perform, and then sends the statements to the server to be executed. For details about which storage engines each statement works with, see the descriptions for those statements in
55
 
Section\ 12.5.2, \(lqTable Maintenance Statements\(rq.
56
 
.PP
57
 
The
58
 
MyISAM
59
 
storage engine supports all four maintenance operations, so
60
 
\fBmysqlcheck\fR
61
 
can be used to perform any of them on
62
 
MyISAM
63
 
tables. Other storage engines do not necessarily support all operations. In such cases, an error message is displayed. For example, if
64
 
test.t
65
 
is a
66
 
MEMORY
67
 
table, an attempt to check it produces this result:
68
 
.sp
69
 
.RS 3n
70
 
.nf
71
 
shell> \fBmysqlcheck test t\fR
72
 
test.t
73
 
note     : The storage engine for the table doesn't support check
74
 
.fi
75
 
.RE
76
 
.PP
77
 
If
78
 
\fBmysqlcheck\fR
79
 
is unable to repair a table, see
80
 
Section\ 2.11.4, \(lqRebuilding or Repairing Tables or Indexes\(rq
81
 
for manual table repair strategies. This will be the case, for example, for
82
 
InnoDB
83
 
tables, which can be checked with
84
 
CHECK TABLE, but not repaired with
85
 
REPAIR TABLE.
86
 
.PP
87
 
The use of
88
 
\fBmysqlcheck\fR
89
 
with partitioned tables is not supported before MySQL 6.0.6.
90
 
.sp
91
 
.it 1 an-trap
92
 
.nr an-no-space-flag 1
93
 
.nr an-break-flag 1
94
 
.br
95
 
\fBCaution\fR
96
 
.PP
97
 
It is best to make a backup of a table before performing a table repair operation; under some circumstances the operation might cause data loss. Possible causes include but are not limited to file system errors.
98
 
.PP
99
 
There are three general ways to invoke
100
 
\fBmysqlcheck\fR:
101
 
.sp
102
 
.RS 3n
103
 
.nf
104
 
shell> \fBmysqlcheck [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIdb_name\fR\fR\fB [\fR\fB\fItables\fR\fR\fB]\fR
105
 
shell> \fBmysqlcheck [\fR\fB\fIoptions\fR\fR\fB] \-\-databases \fR\fB\fIdb_name1\fR\fR\fB [\fR\fB\fIdb_name2\fR\fR\fB \fR\fB\fIdb_name3\fR\fR\fB...]\fR
106
 
shell> \fBmysqlcheck [\fR\fB\fIoptions\fR\fR\fB] \-\-all\-databases\fR
107
 
.fi
108
 
.RE
109
 
.PP
110
 
If you do not name any tables following
111
 
\fIdb_name\fR
112
 
or if you use the
113
 
\fB\-\-databases\fR
114
 
or
115
 
\fB\-\-all\-databases\fR
116
 
option, entire databases are checked.
117
 
.PP
118
 
\fBmysqlcheck\fR
119
 
has a special feature compared to other client programs. The default behavior of checking tables (\fB\-\-check\fR) can be changed by renaming the binary. If you want to have a tool that repairs tables by default, you should just make a copy of
120
 
\fBmysqlcheck\fR
121
 
named
122
 
\fBmysqlrepair\fR, or make a symbolic link to
123
 
\fBmysqlcheck\fR
124
 
named
125
 
\fBmysqlrepair\fR. If you invoke
126
 
\fBmysqlrepair\fR, it repairs tables.
127
 
.PP
128
 
The following names can be used to change
129
 
\fBmysqlcheck\fR
130
 
default behavior.
131
 
.TS
132
 
allbox tab(:);
133
 
l l
134
 
l l
135
 
l l.
136
 
T{
137
 
\fBmysqlrepair\fR
138
 
T}:T{
139
 
The default option is \fB\-\-repair\fR
140
 
T}
141
 
T{
142
 
\fBmysqlanalyze\fR
143
 
T}:T{
144
 
The default option is \fB\-\-analyze\fR
145
 
T}
146
 
T{
147
 
\fBmysqloptimize\fR
148
 
T}:T{
149
 
The default option is \fB\-\-optimize\fR
150
 
T}
151
 
.TE
152
 
.sp
153
 
.PP
154
 
\fBmysqlcheck\fR
155
 
supports the options in the following list. It also reads option files and supports the options for processing them described at
156
 
Section\ 4.2.3.2.1, \(lqCommand\-Line Options that Affect Option\-File Handling\(rq.
157
 
.TP 3n
158
 
\(bu
159
 
\fB\-\-help\fR,
160
 
\fB\-?\fR
161
 
.sp
162
 
Display a help message and exit.
163
 
.TP 3n
164
 
\(bu
165
 
\fB\-\-all\-databases\fR,
166
 
\fB\-A\fR
167
 
.sp
168
 
Check all tables in all databases. This is the same as using the
169
 
\fB\-\-databases\fR
170
 
option and naming all the databases on the command line.
171
 
.TP 3n
172
 
\(bu
173
 
\fB\-\-all\-in\-1\fR,
174
 
\fB\-1\fR
175
 
.sp
176
 
Instead of issuing a statement for each table, execute a single statement for each database that names all the tables from that database to be processed.
177
 
.TP 3n
178
 
\(bu
179
 
\fB\-\-analyze\fR,
180
 
\fB\-a\fR
181
 
.sp
182
 
Analyze the tables.
183
 
.TP 3n
184
 
\(bu
185
 
\fB\-\-auto\-repair\fR
186
 
.sp
187
 
If a checked table is corrupted, automatically fix it. Any necessary repairs are done after all tables have been checked.
188
 
.TP 3n
189
 
\(bu
190
 
\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR
191
 
.sp
192
 
The directory where character sets are installed. See
193
 
Section\ 9.2, \(lqThe Character Set Used for Data and Sorting\(rq.
194
 
.TP 3n
195
 
\(bu
196
 
\fB\-\-check\fR,
197
 
\fB\-c\fR
198
 
.sp
199
 
Check the tables for errors. This is the default operation.
200
 
.TP 3n
201
 
\(bu
202
 
\fB\-\-check\-only\-changed\fR,
203
 
\fB\-C\fR
204
 
.sp
205
 
Check only tables that have changed since the last check or that have not been closed properly.
206
 
.TP 3n
207
 
\(bu
208
 
\fB\-\-check\-upgrade\fR,
209
 
\fB\-g\fR
210
 
.sp
211
 
Invoke
212
 
CHECK TABLE
213
 
with the
214
 
FOR UPGRADE
215
 
option to check tables for incompatibilities with the current version of the server. This option automatically enables the
216
 
\fB\-\-fix\-db\-names\fR
217
 
and
218
 
\fB\-\-fix\-table\-names\fR
219
 
options.
220
 
.TP 3n
221
 
\(bu
222
 
\fB\-\-compress\fR
223
 
.sp
224
 
Compress all information sent between the client and the server if both support compression.
225
 
.TP 3n
226
 
\(bu
227
 
\fB\-\-databases\fR,
228
 
\fB\-B\fR
229
 
.sp
230
 
Process all tables in the named databases. Normally,
231
 
\fBmysqlcheck\fR
232
 
treats the first name argument on the command line as a database name and following names as table names. With this option, it treats all name arguments as database names.
233
 
.TP 3n
234
 
\(bu
235
 
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
236
 
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
237
 
.sp
238
 
Write a debugging log. A typical
239
 
\fIdebug_options\fR
240
 
string is
241
 
\'d:t:o,\fIfile_name\fR'. The default is
242
 
\'d:t:o'.
243
 
.TP 3n
244
 
\(bu
245
 
\fB\-\-debug\-check\fR
246
 
.sp
247
 
Print some debugging information when the program exits.
248
 
.TP 3n
249
 
\(bu
250
 
\fB\-\-debug\-info\fR
251
 
.sp
252
 
Print debugging information and memory and CPU usage statistics when the program exits.
253
 
.TP 3n
254
 
\(bu
255
 
\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
256
 
.sp
257
 
Use
258
 
\fIcharset_name\fR
259
 
as the default character set. See
260
 
Section\ 9.2, \(lqThe Character Set Used for Data and Sorting\(rq.
261
 
.TP 3n
262
 
\(bu
263
 
\fB\-\-extended\fR,
264
 
\fB\-e\fR
265
 
.sp
266
 
If you are using this option to check tables, it ensures that they are 100% consistent but takes a long time.
267
 
.sp
268
 
If you are using this option to repair tables, it runs an extended repair that may not only take a long time to execute, but may produce a lot of garbage rows also!
269
 
.TP 3n
270
 
\(bu
271
 
\fB\-\-fast\fR,
272
 
\fB\-F\fR
273
 
.sp
274
 
Check only tables that have not been closed properly.
275
 
.TP 3n
276
 
\(bu
277
 
\fB\-\-fix\-db\-names\fR
278
 
.sp
279
 
Convert database names to 5.1 format. Only database names that contain special characters are affected.
280
 
.TP 3n
281
 
\(bu
282
 
\fB\-\-fix\-table\-names\fR
283
 
.sp
284
 
Convert table names to 5.1 format. Only table names that contain special characters are affected. As of MySQL 6.0.5, this option also applies to views.
285
 
.TP 3n
286
 
\(bu
287
 
\fB\-\-force\fR,
288
 
\fB\-f\fR
289
 
.sp
290
 
Continue even if an SQL error occurs.
291
 
.TP 3n
292
 
\(bu
293
 
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
294
 
\fB\-h \fR\fB\fIhost_name\fR\fR
295
 
.sp
296
 
Connect to the MySQL server on the given host.
297
 
.TP 3n
298
 
\(bu
299
 
\fB\-\-medium\-check\fR,
300
 
\fB\-m\fR
301
 
.sp
302
 
Do a check that is faster than an
303
 
\fB\-\-extended\fR
304
 
operation. This finds only 99.99% of all errors, which should be good enough in most cases.
305
 
.TP 3n
306
 
\(bu
307
 
\fB\-\-optimize\fR,
308
 
\fB\-o\fR
309
 
.sp
310
 
Optimize the tables.
311
 
.TP 3n
312
 
\(bu
313
 
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
314
 
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
315
 
.sp
316
 
The password to use when connecting to the server. If you use the short option form (\fB\-p\fR), you
317
 
\fIcannot\fR
318
 
have a space between the option and the password. If you omit the
319
 
\fIpassword\fR
320
 
value following the
321
 
\fB\-\-password\fR
322
 
or
323
 
\fB\-p\fR
324
 
option on the command line, you are prompted for one.
325
 
.sp
326
 
Specifying a password on the command line should be considered insecure. See
327
 
Section\ 5.5.6.2, \(lqEnd\-User Guidelines for Password Security\(rq.
328
 
.TP 3n
329
 
\(bu
330
 
\fB\-\-pipe\fR,
331
 
\fB\-W\fR
332
 
.sp
333
 
On Windows, connect to the server via a named pipe. This option applies only for connections to a local server, and only if the server supports named\-pipe connections.
334
 
.TP 3n
335
 
\(bu
336
 
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
337
 
\fB\-P \fR\fB\fIport_num\fR\fR
338
 
.sp
339
 
The TCP/IP port number to use for the connection.
340
 
.TP 3n
341
 
\(bu
342
 
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
343
 
.sp
344
 
The connection protocol to use for connecting to the server. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want. For details on the allowable values, see
345
 
Section\ 4.2.2, \(lqConnecting to the MySQL Server\(rq.
346
 
.TP 3n
347
 
\(bu
348
 
\fB\-\-quick\fR,
349
 
\fB\-q\fR
350
 
.sp
351
 
If you are using this option to check tables, it prevents the check from scanning the rows to check for incorrect links. This is the fastest check method.
352
 
.sp
353
 
If you are using this option to repair tables, it tries to repair only the index tree. This is the fastest repair method.
354
 
.TP 3n
355
 
\(bu
356
 
\fB\-\-repair\fR,
357
 
\fB\-r\fR
358
 
.sp
359
 
Perform a repair that can fix almost anything except unique keys that are not unique.
360
 
.TP 3n
361
 
\(bu
362
 
\fB\-\-silent\fR,
363
 
\fB\-s\fR
364
 
.sp
365
 
Silent mode. Print only error messages.
366
 
.TP 3n
367
 
\(bu
368
 
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
369
 
\fB\-S \fR\fB\fIpath\fR\fR
370
 
.sp
371
 
For connections to
372
 
localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use.
373
 
.TP 3n
374
 
\(bu
375
 
\fB\-\-ssl*\fR
376
 
.sp
377
 
Options that begin with
378
 
\fB\-\-ssl\fR
379
 
specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates. See
380
 
Section\ 5.5.7.3, \(lqSSL Command Options\(rq.
381
 
.TP 3n
382
 
\(bu
383
 
\fB\-\-tables\fR
384
 
.sp
385
 
Overrides the
386
 
\fB\-\-databases\fR
387
 
or
388
 
\fB\-B\fR
389
 
option. All name arguments following the option are regarded as table names.
390
 
.TP 3n
391
 
\(bu
392
 
\fB\-\-use\-frm\fR
393
 
.sp
394
 
For repair operations on
395
 
MyISAM
396
 
tables, get the table structure from the
397
 
\fI.frm\fR
398
 
file so that the table can be repaired even if the
399
 
\fI.MYI\fR
400
 
header is corrupted.
401
 
.TP 3n
402
 
\(bu
403
 
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
404
 
\fB\-u \fR\fB\fIuser_name\fR\fR
405
 
.sp
406
 
The MySQL user name to use when connecting to the server.
407
 
.TP 3n
408
 
\(bu
409
 
\fB\-\-verbose\fR,
410
 
\fB\-v\fR
411
 
.sp
412
 
Verbose mode. Print information about the various stages of program operation.
413
 
.TP 3n
414
 
\(bu
415
 
\fB\-\-version\fR,
416
 
\fB\-V\fR
417
 
.sp
418
 
Display version information and exit.
419
 
.SH "COPYRIGHT"
420
 
.PP
421
 
Copyright 2007\-2008 MySQL AB, 2009 Sun Microsystems, Inc.
422
 
.PP
423
 
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
424
 
.PP
425
 
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.
426
 
.PP
427
 
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/.
428
 
.SH "SEE ALSO"
429
 
For more information, please refer to the MySQL Reference Manual,
430
 
which may already be installed locally and which is also available
431
 
online at http://dev.mysql.com/doc/.
432
 
.SH AUTHOR
433
 
Sun Microsystems, Inc. (http://www.mysql.com/).