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