56
56
{"all-databases", 'A',
57
57
"Check all the databases. This will be same as --databases with all databases selected.",
58
(uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
58
(char**) &opt_alldbs, (char**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
60
60
{"analyze", 'a', "Analyze given tables.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
63
63
"Instead of issuing one query for each table, use one query per database, naming all tables in the database in a comma-separated list.",
64
(uchar**) &opt_all_in_1, (uchar**) &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0,
64
(char**) &opt_all_in_1, (char**) &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0,
66
66
{"auto-repair", OPT_AUTO_REPAIR,
67
67
"If a checked table is corrupted, automatically fix it. Repairing will be done after all tables have been checked, if corrupted ones were found.",
68
(uchar**) &opt_auto_repair, (uchar**) &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0,
68
(char**) &opt_auto_repair, (char**) &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0,
70
70
{"character-sets-dir", OPT_CHARSETS_DIR,
71
"Directory where character sets are.", (uchar**) &charsets_dir,
72
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
71
"Directory where character sets are.", (char**) &charsets_dir,
72
(char**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
73
73
{"check", 'c', "Check table for errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
75
75
{"check-only-changed", 'C',
79
79
"Check tables for version-dependent changes. May be used with --auto-repair to correct tables requiring version-dependent updates.",
80
80
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
81
81
{"compress", OPT_COMPRESS, "Use compression in server/client protocol.",
82
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
82
(char**) &opt_compress, (char**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
85
85
"To check several databases. Note the difference in usage; In this case no tables are given. All name arguments are regarded as databasenames.",
86
(uchar**) &opt_databases, (uchar**) &opt_databases, 0, GET_BOOL, NO_ARG,
86
(char**) &opt_databases, (char**) &opt_databases, 0, GET_BOOL, NO_ARG,
89
89
{"debug", '#', "This is a non-debug version. Catch this and exit.",
93
93
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
95
95
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
96
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
96
(char**) &debug_check_flag, (char**) &debug_check_flag, 0,
97
97
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
98
98
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
99
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
99
(char**) &debug_info_flag, (char**) &debug_info_flag,
100
100
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
101
101
{"default-character-set", OPT_DEFAULT_CHARSET,
102
"Set the default character set.", (uchar**) &default_charset,
103
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
102
"Set the default character set.", (char**) &default_charset,
103
(char**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
104
104
{"fast",'F', "Check only tables that haven't been closed properly.",
105
(uchar**) &opt_fast, (uchar**) &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
105
(char**) &opt_fast, (char**) &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
107
107
{"fix-db-names", OPT_FIX_DB_NAMES, "Fix database names.",
108
(uchar**) &opt_fix_db_names, (uchar**) &opt_fix_db_names,
108
(char**) &opt_fix_db_names, (char**) &opt_fix_db_names,
109
109
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
110
110
{"fix-table-names", OPT_FIX_TABLE_NAMES, "Fix table names.",
111
(uchar**) &opt_fix_table_names, (uchar**) &opt_fix_table_names,
111
(char**) &opt_fix_table_names, (char**) &opt_fix_table_names,
112
112
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
113
113
{"force", 'f', "Continue even if we get an sql-error.",
114
(uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
114
(char**) &ignore_errors, (char**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
116
116
{"extended", 'e',
117
117
"If you are using this option with CHECK TABLE, it will ensure that the table is 100 percent consistent, but will take a long time. If you are using this option with REPAIR TABLE, it will force using old slow repair with keycache method, instead of much faster repair by sorting.",
118
(uchar**) &opt_extended, (uchar**) &opt_extended, 0, GET_BOOL, NO_ARG, 0, 0, 0,
118
(char**) &opt_extended, (char**) &opt_extended, 0, GET_BOOL, NO_ARG, 0, 0, 0,
120
120
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
121
121
NO_ARG, 0, 0, 0, 0, 0, 0},
122
{"host",'h', "Connect to host.", (uchar**) ¤t_host,
123
(uchar**) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
122
{"host",'h', "Connect to host.", (char**) ¤t_host,
123
(char**) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
124
124
{"medium-check", 'm',
125
125
"Faster than extended-check, but only finds 99.99 percent of all errors. Should be good enough for most cases.",
126
126
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
127
127
{"write-binlog", OPT_WRITE_BINLOG,
128
128
"Log ANALYZE, OPTIMIZE and REPAIR TABLE commands. Use --skip-write-binlog when commands should not be sent to replication slaves.",
129
(uchar**) &opt_write_binlog, (uchar**) &opt_write_binlog, 0, GET_BOOL, NO_ARG,
129
(char**) &opt_write_binlog, (char**) &opt_write_binlog, 0, GET_BOOL, NO_ARG,
130
130
1, 0, 0, 0, 0, 0},
131
131
{"optimize", 'o', "Optimize table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
139
139
"/etc/services, "
141
141
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
142
(uchar**) &opt_mysql_port,
143
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
142
(char**) &opt_mysql_port,
143
(char**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
145
145
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
146
146
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
148
148
"If you are using this option with CHECK TABLE, it prevents the check from scanning the rows to check for wrong links. This is the fastest check. If you are using this option with REPAIR TABLE, it will try to repair only the index tree. This is the fastest repair method for a table.",
149
(uchar**) &opt_quick, (uchar**) &opt_quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
149
(char**) &opt_quick, (char**) &opt_quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
152
152
"Can fix almost anything except unique keys that aren't unique.",
153
153
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
155
155
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
156
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
156
"Base name of shared memory.", (char**) &shared_memory_base_name, (char**) &shared_memory_base_name,
157
157
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
159
{"silent", 's', "Print only error messages.", (uchar**) &opt_silent,
160
(uchar**) &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
159
{"silent", 's', "Print only error messages.", (char**) &opt_silent,
160
(char**) &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
161
161
{"socket", 'S', "Socket file to use for connection.",
162
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
162
(char**) &opt_mysql_unix_port, (char**) &opt_mysql_unix_port, 0, GET_STR,
163
163
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
164
164
{"tables", OPT_TABLES, "Overrides option --databases (-B).", 0, 0, 0,
165
165
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
166
166
{"use-frm", OPT_FRM,
167
167
"When used with REPAIR, get table structure from .frm file, so the table can be repaired even if .MYI header is corrupted.",
168
(uchar**) &opt_frm, (uchar**) &opt_frm, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
168
(char**) &opt_frm, (char**) &opt_frm, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
170
170
#ifndef DONT_ALLOW_USER_CHANGE
171
{"user", 'u', "User for login if not current user.", (uchar**) ¤t_user,
172
(uchar**) ¤t_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
171
{"user", 'u', "User for login if not current user.", (char**) ¤t_user,
172
(char**) ¤t_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
174
174
{"verbose", 'v', "Print info about the various stages.", 0, 0, 0, GET_NO_ARG,
175
175
NO_ARG, 0, 0, 0, 0, 0, 0},