176
179
static struct my_option my_long_options[] =
178
181
{"all", 'a', "Deprecated. Use --create-options instead.",
179
(char**) &create_options, (char**) &create_options, 0, GET_BOOL, NO_ARG, 1,
182
(uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1,
181
184
{"all-databases", 'A',
182
185
"Dump all the databases. This will be same as --databases with all databases selected.",
183
(char**) &opt_alldbs, (char**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
186
(uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
185
188
{"all-tablespaces", 'Y',
186
189
"Dump all the tablespaces.",
187
(char**) &opt_alltspcs, (char**) &opt_alltspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
190
(uchar**) &opt_alltspcs, (uchar**) &opt_alltspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
189
192
{"no-tablespaces", 'y',
190
193
"Do not dump any tablespace information.",
191
(char**) &opt_notspcs, (char**) &opt_notspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
194
(uchar**) &opt_notspcs, (uchar**) &opt_notspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
193
196
{"add-drop-database", OPT_DROP_DATABASE, "Add a 'DROP DATABASE' before each create.",
194
(char**) &opt_drop_database, (char**) &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
197
(uchar**) &opt_drop_database, (uchar**) &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
196
199
{"add-drop-table", OPT_DROP, "Add a 'drop table' before each create.",
197
(char**) &opt_drop, (char**) &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
200
(uchar**) &opt_drop, (uchar**) &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
199
202
{"add-locks", OPT_LOCKS, "Add locks around insert statements.",
200
(char**) &opt_lock, (char**) &opt_lock, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
203
(uchar**) &opt_lock, (uchar**) &opt_lock, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
202
205
{"allow-keywords", OPT_KEYWORDS,
203
"Allow creation of column names that are keywords.", (char**) &opt_keywords,
204
(char**) &opt_keywords, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
206
"Allow creation of column names that are keywords.", (uchar**) &opt_keywords,
207
(uchar**) &opt_keywords, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
205
208
{"apply-slave-statements", OPT_MYSQLDUMP_SLAVE_APPLY,
206
209
"Adds 'STOP SLAVE' prior to 'CHANGE MASTER' and 'START SLAVE' to bottom of dump.",
207
(char**) &opt_slave_apply, (char**) &opt_slave_apply, 0, GET_BOOL, NO_ARG,
210
(uchar**) &opt_slave_apply, (uchar**) &opt_slave_apply, 0, GET_BOOL, NO_ARG,
208
211
0, 0, 0, 0, 0, 0},
209
212
{"character-sets-dir", OPT_CHARSETS_DIR,
210
"Directory where character sets are.", (char**) &charsets_dir,
211
(char**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
213
"Directory where character sets are.", (uchar**) &charsets_dir,
214
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
212
215
{"comments", 'i', "Write additional information.",
213
(char**) &opt_comments, (char**) &opt_comments, 0, GET_BOOL, NO_ARG,
216
(uchar**) &opt_comments, (uchar**) &opt_comments, 0, GET_BOOL, NO_ARG,
214
217
1, 0, 0, 0, 0, 0},
215
218
{"compatible", OPT_COMPATIBLE,
216
219
"Change the dump to be compatible with a given mode. By default tables are dumped in a format optimized for MySQL. Legal modes are: ansi, mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, no_field_options. One can use several modes separated by commas. Note: Requires MySQL server version 4.1.0 or higher. This option is ignored with earlier server versions.",
217
(char**) &opt_compatible_mode_str, (char**) &opt_compatible_mode_str, 0,
220
(uchar**) &opt_compatible_mode_str, (uchar**) &opt_compatible_mode_str, 0,
218
221
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
219
222
{"compact", OPT_COMPACT,
220
223
"Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys --skip-add-locks",
221
(char**) &opt_compact, (char**) &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
224
(uchar**) &opt_compact, (uchar**) &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
223
226
{"complete-insert", 'c', "Use complete insert statements.",
224
(char**) &opt_complete_insert, (char**) &opt_complete_insert, 0, GET_BOOL,
227
(uchar**) &opt_complete_insert, (uchar**) &opt_complete_insert, 0, GET_BOOL,
225
228
NO_ARG, 0, 0, 0, 0, 0, 0},
226
229
{"compress", 'C', "Use compression in server/client protocol.",
227
(char**) &opt_compress, (char**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
230
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
229
232
{"create-options", OPT_CREATE_OPTIONS,
230
233
"Include all MySQL specific create options.",
231
(char**) &create_options, (char**) &create_options, 0, GET_BOOL, NO_ARG, 1,
234
(uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1,
233
236
{"databases", 'B',
234
237
"To dump several databases. Note the difference in usage; In this case no tables are given. All name arguments are regarded as databasenames. 'USE db_name;' will be included in the output.",
235
(char**) &opt_databases, (char**) &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0,
238
(uchar**) &opt_databases, (uchar**) &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0,
241
{"debug", '#', "This is a non-debug version. Catch this and exit",
242
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
244
{"debug", '#', "Output debug log", (uchar**) &default_dbug_option,
245
(uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
237
247
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
238
(char**) &debug_check_flag, (char**) &debug_check_flag, 0,
248
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
239
249
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
240
250
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
241
(char**) &debug_info_flag, (char**) &debug_info_flag,
251
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
242
252
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
243
253
{"default-character-set", OPT_DEFAULT_CHARSET,
244
"Set the default character set.", (char**) &default_charset,
245
(char**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
254
"Set the default character set.", (uchar**) &default_charset,
255
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
246
256
{"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED; ",
247
(char**) &opt_delayed, (char**) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
257
(uchar**) &opt_delayed, (uchar**) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
249
259
{"delete-master-logs", OPT_DELETE_MASTER_LOGS,
250
260
"Delete logs on master after backup. This automatically enables --master-data.",
251
(char**) &opt_delete_master_logs, (char**) &opt_delete_master_logs, 0,
261
(uchar**) &opt_delete_master_logs, (uchar**) &opt_delete_master_logs, 0,
252
262
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
253
263
{"disable-keys", 'K',
254
"'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", (char**) &opt_disable_keys,
255
(char**) &opt_disable_keys, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
264
"'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", (uchar**) &opt_disable_keys,
265
(uchar**) &opt_disable_keys, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
256
266
{"dump-slave", OPT_MYSQLDUMP_SLAVE_DATA,
257
267
"This causes the binary log position and filename of the master to be "
258
268
"appended to the dumped data output. Setting the value to 1, will print"
264
274
"- don't forget to read about --single-transaction below). In all cases "
265
275
"any action on logs will happen at the exact moment of the dump."
266
276
"Option automatically turns --lock-tables off.",
267
(char**) &opt_slave_data, (char**) &opt_slave_data, 0,
277
(uchar**) &opt_slave_data, (uchar**) &opt_slave_data, 0,
268
278
GET_UINT, OPT_ARG, 0, 0, MYSQL_OPT_SLAVE_DATA_COMMENTED_SQL, 0, 0, 0},
269
279
{"events", 'E', "Dump events.",
270
(char**) &opt_events, (char**) &opt_events, 0, GET_BOOL,
280
(uchar**) &opt_events, (uchar**) &opt_events, 0, GET_BOOL,
271
281
NO_ARG, 0, 0, 0, 0, 0, 0},
272
282
{"extended-insert", 'e',
273
283
"Allows utilization of the new, much faster INSERT syntax.",
274
(char**) &extended_insert, (char**) &extended_insert, 0, GET_BOOL, NO_ARG,
284
(uchar**) &extended_insert, (uchar**) &extended_insert, 0, GET_BOOL, NO_ARG,
275
285
1, 0, 0, 0, 0, 0},
276
286
{"fields-terminated-by", OPT_FTB,
277
"Fields in the textfile are terminated by ...", (char**) &fields_terminated,
278
(char**) &fields_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
287
"Fields in the textfile are terminated by ...", (uchar**) &fields_terminated,
288
(uchar**) &fields_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
279
289
{"fields-enclosed-by", OPT_ENC,
280
"Fields in the importfile are enclosed by ...", (char**) &enclosed,
281
(char**) &enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
290
"Fields in the importfile are enclosed by ...", (uchar**) &enclosed,
291
(uchar**) &enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
282
292
{"fields-optionally-enclosed-by", OPT_O_ENC,
283
"Fields in the i.file are opt. enclosed by ...", (char**) &opt_enclosed,
284
(char**) &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
293
"Fields in the i.file are opt. enclosed by ...", (uchar**) &opt_enclosed,
294
(uchar**) &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
285
295
{"fields-escaped-by", OPT_ESC, "Fields in the i.file are escaped by ...",
286
(char**) &escaped, (char**) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
296
(uchar**) &escaped, (uchar**) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
287
297
{"first-slave", 'x', "Deprecated, renamed to --lock-all-tables.",
288
(char**) &opt_lock_all_tables, (char**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
298
(uchar**) &opt_lock_all_tables, (uchar**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
289
299
0, 0, 0, 0, 0, 0},
290
300
{"flush-logs", 'F', "Flush logs file in server before starting dump. "
291
301
"Note that if you dump many databases at once (using the option "
296
306
"to the moment all tables are locked. So if you want your dump and "
297
307
"the log flush to happen at the same exact moment you should use "
298
308
"--lock-all-tables or --master-data with --flush-logs",
299
(char**) &flush_logs, (char**) &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
309
(uchar**) &flush_logs, (uchar**) &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
301
311
{"flush-privileges", OPT_ESC, "Emit a FLUSH PRIVILEGES statement "
302
312
"after dumping the mysql database. This option should be used any "
303
313
"time the dump contains the mysql database and any other database "
304
314
"that depends on the data in the mysql database for proper restore. ",
305
(char**) &flush_privileges, (char**) &flush_privileges, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
315
(uchar**) &flush_privileges, (uchar**) &flush_privileges, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
307
317
{"force", 'f', "Continue even if we get an sql-error.",
308
(char**) &ignore_errors, (char**) &ignore_errors, 0, GET_BOOL, NO_ARG,
318
(uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG,
309
319
0, 0, 0, 0, 0, 0},
310
320
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
311
321
NO_ARG, 0, 0, 0, 0, 0, 0},
312
322
{"hex-blob", OPT_HEXBLOB, "Dump binary strings (BINARY, "
313
323
"VARBINARY, BLOB) in hexadecimal format.",
314
(char**) &opt_hex_blob, (char**) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
315
{"host", 'h', "Connect to host.", (char**) ¤t_host,
316
(char**) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
324
(uchar**) &opt_hex_blob, (uchar**) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
325
{"host", 'h', "Connect to host.", (uchar**) ¤t_host,
326
(uchar**) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
317
327
{"ignore-table", OPT_IGNORE_TABLE,
318
328
"Do not dump the specified table. To specify more than one table to ignore, "
319
329
"use the directive multiple times, once for each table. Each table must "
321
331
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
322
332
{"include-master-host-port", OPT_MYSQLDUMP_INCLUDE_MASTER_HOST_PORT,
323
333
"Adds 'MASTER_HOST=<host>, MASTER_PORT=<port>' to 'CHANGE MASTER TO..' in dump produced with --dump-slave.",
324
(char**) &opt_include_master_host_port,
325
(char**) &opt_include_master_host_port,
334
(uchar**) &opt_include_master_host_port,
335
(uchar**) &opt_include_master_host_port,
326
336
0, GET_BOOL, NO_ARG,
327
337
0, 0, 0, 0, 0, 0},
328
338
{"insert-ignore", OPT_INSERT_IGNORE, "Insert rows with INSERT IGNORE.",
329
(char**) &opt_ignore, (char**) &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
339
(uchar**) &opt_ignore, (uchar**) &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
331
341
{"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...",
332
(char**) &lines_terminated, (char**) &lines_terminated, 0, GET_STR,
342
(uchar**) &lines_terminated, (uchar**) &lines_terminated, 0, GET_STR,
333
343
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
334
344
{"lock-all-tables", 'x', "Locks all tables across all databases. This "
335
345
"is achieved by taking a global read lock for the duration of the whole "
336
346
"dump. Automatically turns --single-transaction and --lock-tables off.",
337
(char**) &opt_lock_all_tables, (char**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
347
(uchar**) &opt_lock_all_tables, (uchar**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
338
348
0, 0, 0, 0, 0, 0},
339
{"lock-tables", 'l', "Lock all tables for read.", (char**) &lock_tables,
340
(char**) &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
349
{"lock-tables", 'l', "Lock all tables for read.", (uchar**) &lock_tables,
350
(uchar**) &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
341
351
{"log-error", OPT_ERROR_LOG_FILE, "Append warnings and errors to given file.",
342
(char**) &log_error_file, (char**) &log_error_file, 0, GET_STR,
352
(uchar**) &log_error_file, (uchar**) &log_error_file, 0, GET_STR,
343
353
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
344
354
{"master-data", OPT_MASTER_DATA,
345
355
"This causes the binary log position and filename to be appended to the "
351
361
"- don't forget to read about --single-transaction below). In all cases "
352
362
"any action on logs will happen at the exact moment of the dump."
353
363
"Option automatically turns --lock-tables off.",
354
(char**) &opt_master_data, (char**) &opt_master_data, 0,
364
(uchar**) &opt_master_data, (uchar**) &opt_master_data, 0,
355
365
GET_UINT, OPT_ARG, 0, 0, MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, 0, 0, 0},
356
366
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "",
357
(char**) &opt_max_allowed_packet, (char**) &opt_max_allowed_packet, 0,
367
(uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0,
358
368
GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096,
359
(int64_t) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
369
(longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
360
370
{"net_buffer_length", OPT_NET_BUFFER_LENGTH, "",
361
(char**) &opt_net_buffer_length, (char**) &opt_net_buffer_length, 0,
371
(uchar**) &opt_net_buffer_length, (uchar**) &opt_net_buffer_length, 0,
362
372
GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L,
363
373
MALLOC_OVERHEAD-1024, 1024, 0},
364
374
{"no-autocommit", OPT_AUTOCOMMIT,
365
375
"Wrap tables with autocommit/commit statements.",
366
(char**) &opt_autocommit, (char**) &opt_autocommit, 0, GET_BOOL, NO_ARG,
376
(uchar**) &opt_autocommit, (uchar**) &opt_autocommit, 0, GET_BOOL, NO_ARG,
367
377
0, 0, 0, 0, 0, 0},
368
378
{"no-create-db", 'n',
369
379
"'CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;' will not be put in the output. The above line will be added otherwise, if --databases or --all-databases option was given.}.",
370
(char**) &opt_create_db, (char**) &opt_create_db, 0, GET_BOOL, NO_ARG, 0, 0,
380
(uchar**) &opt_create_db, (uchar**) &opt_create_db, 0, GET_BOOL, NO_ARG, 0, 0,
372
382
{"no-create-info", 't', "Don't write table creation info.",
373
(char**) &opt_no_create_info, (char**) &opt_no_create_info, 0, GET_BOOL,
383
(uchar**) &opt_no_create_info, (uchar**) &opt_no_create_info, 0, GET_BOOL,
374
384
NO_ARG, 0, 0, 0, 0, 0, 0},
375
{"no-data", 'd', "No row information.", (char**) &opt_no_data,
376
(char**) &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
385
{"no-data", 'd', "No row information.", (uchar**) &opt_no_data,
386
(uchar**) &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
377
387
{"no-set-names", 'N',
378
388
"Deprecated. Use --skip-set-charset instead.",
379
389
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
382
392
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
383
393
{"order-by-primary", OPT_ORDER_BY_PRIMARY,
384
394
"Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.",
385
(char**) &opt_order_by_primary, (char**) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
395
(uchar**) &opt_order_by_primary, (uchar**) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
386
396
{"password", 'p',
387
397
"Password to use when connecting to server. If password is not given it's solicited on the tty.",
388
398
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
389
{"port", 'P', "Port number to use for connection.", (char**) &opt_mysql_port,
390
(char**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
399
{"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
400
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
392
402
{"quick", 'q', "Don't buffer query, dump directly to stdout.",
393
(char**) &quick, (char**) &quick, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
403
(uchar**) &quick, (uchar**) &quick, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
394
404
{"quote-names",'Q', "Quote table and column names with backticks (`).",
395
(char**) &opt_quoted, (char**) &opt_quoted, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
405
(uchar**) &opt_quoted, (uchar**) &opt_quoted, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
397
407
{"replace", OPT_MYSQL_REPLACE_INTO, "Use REPLACE INTO instead of INSERT INTO.",
398
(char**) &opt_replace_into, (char**) &opt_replace_into, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
408
(uchar**) &opt_replace_into, (uchar**) &opt_replace_into, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
400
410
{"result-file", 'r',
401
411
"Direct output to a given file. This option should be used in MSDOS, because it prevents new line '\\n' from being converted to '\\r\\n' (carriage return + line feed).",
402
412
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
403
413
{"routines", 'R', "Dump stored routines (functions and procedures).",
404
(char**) &opt_routines, (char**) &opt_routines, 0, GET_BOOL,
414
(uchar**) &opt_routines, (uchar**) &opt_routines, 0, GET_BOOL,
405
415
NO_ARG, 0, 0, 0, 0, 0, 0},
406
416
{"set-charset", OPT_SET_CHARSET,
407
417
"Add 'SET NAMES default_character_set' to the output.",
408
(char**) &opt_set_charset, (char**) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1,
418
(uchar**) &opt_set_charset, (uchar**) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1,
410
420
{"set-variable", 'O',
411
421
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
412
422
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
424
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
425
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
426
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
414
429
Note that the combination --single-transaction --master-data
415
430
will give bullet-proof binlog position only if server >=4.1.3. That's the
425
440
"connection should use the following statements: ALTER TABLE, DROP "
426
441
"TABLE, RENAME TABLE, TRUNCATE TABLE, as consistent snapshot is not "
427
442
"isolated from them. Option automatically turns off --lock-tables.",
428
(char**) &opt_single_transaction, (char**) &opt_single_transaction, 0,
443
(uchar**) &opt_single_transaction, (uchar**) &opt_single_transaction, 0,
429
444
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
430
445
{"dump-date", OPT_DUMP_DATE, "Put a dump date to the end of the output.",
431
(char**) &opt_dump_date, (char**) &opt_dump_date, 0,
446
(uchar**) &opt_dump_date, (uchar**) &opt_dump_date, 0,
432
447
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
433
448
{"skip-opt", OPT_SKIP_OPTIMIZATION,
434
449
"Disable --opt. Disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys.",
435
450
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
437
452
"Creates tab separated textfile for each table to given path. (creates .sql and .txt files). NOTE: This only works if mysqldump is run on the same machine as the mysqld daemon.",
438
(char**) &path, (char**) &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
453
(uchar**) &path, (uchar**) &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
439
454
{"tables", OPT_TABLES, "Overrides option --databases (-B).",
440
455
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
441
456
{"tz-utc", OPT_TZ_UTC,
442
457
"SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones.",
443
(char**) &opt_tz_utc, (char**) &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
458
(uchar**) &opt_tz_utc, (uchar**) &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
444
459
#ifndef DONT_ALLOW_USER_CHANGE
445
460
{"user", 'u', "User for login if not current user.",
446
(char**) ¤t_user, (char**) ¤t_user, 0, GET_STR, REQUIRED_ARG,
461
(uchar**) ¤t_user, (uchar**) ¤t_user, 0, GET_STR, REQUIRED_ARG,
447
462
0, 0, 0, 0, 0, 0},
449
464
{"verbose", 'v', "Print info about the various stages.",
450
(char**) &verbose, (char**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
465
(uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
451
466
{"version",'V', "Output version information and exit.", 0, 0, 0,
452
467
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
453
468
{"where", 'w', "Dump only selected records; QUOTES mandatory!",
454
(char**) &where, (char**) &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
469
(uchar**) &where, (uchar**) &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
455
470
{"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG,
456
471
NO_ARG, 0, 0, 0, 0, 0, 0},
457
472
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}