{"help",'?',"Display this help and exit.",0,0,0,GET_NO_ARG,NO_ARG,0,
0,0,0,0,0},
{"auto-rehash",OPT_AUTO_REHASH,
"Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash.",
"No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect. WARNING: options depricated; use --disable-auto-rehash instead.",
0,0,0,GET_NO_ARG,NO_ARG,0,0,0,0,0,0},
{"batch",'B',
"Print results with a tab as separator, each row on new line. Doesn't use history file.",0,0,0,GET_NO_ARG,NO_ARG,0,0,0,0,0,0},
{"character-sets-dir",OPT_CHARSETS_DIR,
"Directory where character sets are.",(gptr*)&charsets_dir,
{"no-named-commands",'g',"Named commands are disabled. Use \\* form only, or use named commands only in the beginning of a line ending with a semicolon (;) Since version 10.9 the client now starts with this option ENABLED by default! Disable with '-G'. Long format commands still work from the first line. WARNING: option depricated; use --disable-named-commands instead.",
0,0,0,GET_NO_ARG,NO_ARG,0,0,0,0,0,0},
{"named-commands",'G',
"Enable named commands. Disable with --disable-named-commands. This option is disabled by default.",
"Don't write column names in results. WARNING: -N is depricated, use long version of this options instead.",
0,0,0,GET_NO_ARG,NO_ARG,0,0,0,0,0,0},
{"set-variable",'O',
"Change the value of a variable. Please note that this option is depricated; you can set variables directly with --variable-name=value.",
0,0,0,GET_STR,REQUIRED_ARG,0,0,0,0,0,0},
{"one-database",'o',
"Only update the default database. This is useful for skipping updates to other database in the update log.",
0,0,0,GET_NO_ARG,NO_ARG,0,0,0,0,0,0},
#ifndef __WIN__
{"no-pager",no_argument,0,OPT_NOPAGER},
{"nopager",no_argument,0,OPT_NOPAGER},/* we are kind */
{"pager",optional_argument,0,OPT_PAGER},
{"pager",OPT_PAGER,
"Pager to use to display results. If you don't supply an option the default pager is taken from your ENV variable PAGER. Valid pagers are less, more, cat [> filename], etc. See interactive help (\\h) also. This option does not work in batch mode.",
0,0,0,GET_STR,OPT_ARG,0,0,0,0,0,0},
#endif
{"no-tee",no_argument,0,OPT_NOTEE},
{"notee",no_argument,0,OPT_NOTEE},/* we are kind */
{"tee",required_argument,0,OPT_TEE},
{"one-database",no_argument,0,'o'},
{"password",optional_argument,0,'p'},
{"password",'p',
"Password to use when connecting to server. If password is not given it's asked from the tty.",
0,0,0,GET_STR,OPT_ARG,0,0,0,0,0,0},
#ifdef __WIN__
{"pipe",no_argument,0,'W'},
{"pipe",'W',"Use named pipes to connect to server.",0,0,0,GET_NO_ARG,
NO_ARG,0,0,0,0,0,0},
#endif
{"port",required_argument,0,'P'},
{"prompt",required_argument,0,OPT_PROMPT},
{"quick",no_argument,0,'q'},
{"set-variable",required_argument,0,'O'},
{"raw",no_argument,0,'r'},
{"safe-updates",optional_argument,0,'U'},
{"silent",no_argument,0,'s'},
{"skip-column-names",no_argument,0,'N'},
{"skip-line-numbers",no_argument,0,'L'},
{"socket",required_argument,0,'S'},
{"port",'P',"Port number to use for connection.",0,0,0,
GET_LONG,REQUIRED_ARG,0,0,0,0,0,0},
{"prompt",OPT_PROMPT,"Set the mysql prompt to this value.",0,0,0,
GET_STR,REQUIRED_ARG,0,0,0,0,0,0},
{"quick",'q',
"Don't cache result, print it row by row. This may slow down the server if the output is suspended. Doesn't use history file. ",
puts("Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB");
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
puts("Administration program for the mysqld daemon.");
{"analyze",'a',"Analyze given tables.",0,0,0,GET_NO_ARG,NO_ARG,0,0,
0,0,0,0},
{"all-in-1",'1',
"Instead of making one query for each table, execute all queries in 1 query separately for each database. Table names will be in a comma separeted list.",
"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 run an extended repair on the table, which may not only take a long time to execute, but may produce a lot of garbage rows also!",
"Password to use when connecting to server. If password is not given it's solicited on the tty.",
0,0,0,GET_STR,OPT_ARG,0,0,0,0,0,0},
#ifdef __WIN__
{"pipe",no_argument,0,'W'},
{"pipe",'W',"Use named pipes to connect to server.",0,0,0,GET_NO_ARG,
NO_ARG,0,0,0,0,0,0},
#endif
{"port",required_argument,0,'P'},
{"quick",no_argument,0,'q'},
{"repair",no_argument,0,'r'},
{"silent",no_argument,0,'s'},
{"socket",required_argument,0,'S'},
{"port",'P',"Port number to use for connection.",0,0,0,GET_LONG,
REQUIRED_ARG,0,0,0,0,0,0},
{"quick",'q',
"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.",
"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.",
"'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.",(gptr*)&opt_disable_keys,
"'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.}",
"Direct output to a given file. This option should be used in MSDOS, because it prevents new line '\\n' from being converted to '\\n\\r' (newline + carriage return).",
"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.",
{"user",'u',"User for login if not current user.",(gptr*)&user,
(gptr*)&user,0,GET_STR,REQUIRED_ARG,0,0,0,0,0,0},
#endif
{"verbose",no_argument,0,'v'},
{"version",no_argument,0,'V'},
{0,0,0,0}
{"verbose",'v',
"More verbose output; You can use this multiple times to get even more verbose output.",
0,0,0,GET_NO_ARG,NO_ARG,0,0,0,0,0,0},
{"version",'V',"Output version information and exit.",0,0,0,GET_NO_ARG,
NO_ARG,0,0,0,0,0,0},
{0,0,0,0,0,0,GET_NO_ARG,NO_ARG,0,0,0,0,0,0}
};
staticvoidprint_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,SHOW_VERSION,
...
...
@@ -160,33 +180,6 @@ static void usage(void)
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
puts("Shows the structure of a mysql database (databases,tables and columns)\n");
"Try to recover every possible row from the data file. Normally this will also find a lot of garbage rows; Don't use this option if you are not totally desperate.",0,0,0,GET_NO_ARG,NO_ARG,'e',0,0,0,0,0,0},
{"fast","Check only tables that hasn't been closed properly.",0,0,0,
GET_NO_ARG,NO_ARG,'F',0,0,0,0,0,0},
{"force",
"Restart with -r if there are any errors in the table. States will be updated as with --update-state.",0,0,0,GET_NO_ARG,NO_ARG,'f',0,0,0,0,0,
{"extend-check",'e',
"Try to recover every possible row from the data file. Normally this will also find a lot of garbage rows; Don't use this option if you are not totally desperate.",0,0,0,GET_NO_ARG,NO_ARG,0,0,0,0,0,0},
{"fast",'F',"Check only tables that hasn't been closed properly.",0,0,0,
GET_NO_ARG,NO_ARG,0,0,0,0,0,0},
{"force",'f',
"Restart with -r if there are any errors in the table. States will be updated as with --update-state.",0,0,0,GET_NO_ARG,NO_ARG,0,0,0,0,0,
0},
{"help","Display this help and exit.",0,0,0,GET_NO_ARG,NO_ARG,'?',0,
{"help",'?',"Display this help and exit.",0,0,0,GET_NO_ARG,NO_ARG,0,
0,0,0,0,0},
{"information","Print statistics information about table that is checked.",
0,0,0,GET_NO_ARG,NO_ARG,'i',0,0,0,0,0,0},
{"keys-used","Tell MyISAM to update only some specific keys. # is a bit mask of which keys to use. This can be used to get faster inserts!",
{"information",'i',
"Print statistics information about table that is checked.",0,0,0,
GET_NO_ARG,NO_ARG,0,0,0,0,0,0},
{"keys-used",'k',
"Tell MyISAM to update only some specific keys. # is a bit mask of which keys to use. This can be used to get faster inserts!",
"Faster than extended-check, but only finds 99.99% of all errors. Should be good enough for most cases.",0,0,0,GET_NO_ARG,NO_ARG,'m',0,0,0,0,0,
0},
{"quick","Faster repair by not modifying the data file.",0,0,0,
GET_NO_ARG,NO_ARG,'q',0,0,0,0,0,0},
{"read-only","Don't mark table as checked.",0,0,0,GET_NO_ARG,NO_ARG,
'T',0,0,0,0,0,0},
{"recover",
GET_LL,REQUIRED_ARG,-1,0,0,0,0,0},
{"medium-check",'m',
"Faster than extended-check, but only finds 99.99% of all errors. Should be good enough for most cases.",
0,0,0,GET_NO_ARG,NO_ARG,0,0,0,0,0,0},
{"quick",'q',"Faster repair by not modifying the data file.",0,0,0,
GET_NO_ARG,NO_ARG,0,0,0,0,0,0},
{"read-only",'T',"Don't mark table as checked.",0,0,0,GET_NO_ARG,
NO_ARG,0,0,0,0,0,0},
{"recover",'r',
"Can fix almost anything except unique keys that aren't unique.",0,0,0,
GET_NO_ARG,NO_ARG,'r',0,0,0,0,0,0},
{"safe-recover",
GET_NO_ARG,NO_ARG,0,0,0,0,0,0},
{"safe-recover",'o',
"Uses old recovery method; Slower than '-r' but can handle a couple of cases where '-r' reports that it can't fix the data file.",0,0,0,GET_NO_ARG,
NO_ARG,'o',0,0,0,0,0,0},
{"start-check-pos","No help available.",0,0,0,GET_LONG,REQUIRED_ARG,
OPT_START_CHECK_POS,0,0,0,0,0,0},
{"set-auto-increment",
NO_ARG,0,0,0,0,0,0},
{"start-check-pos",OPT_START_CHECK_POS,"No help available.",0,0,0,
GET_LONG,REQUIRED_ARG,0,0,0,0,0,0},
{"set-auto-increment",'A',
"Force auto_increment to start at this or higher value. If no value is given, then sets the next auto_increment value to the highest used value for the auto key + 1.",(gptr*)&check_param.auto_increment_value,
{"set-variable","Change the value of a variable. Please note that this option is depricated; you can set variables directly with --variable-name=value.",
"Change the character set used by the index",0,0,0,GET_STR,
REQUIRED_ARG,0,0,0,0,0,0},
{"set-variable",'O',
"Change the value of a variable. Please note that this option is depricated; you can set variables directly with --variable-name=value.",
0,0,0,GET_STR,REQUIRED_ARG,0,0,0,0,0,0},
{"silent",'s',
"Only print errors. One can use two -s to make myisamchk very silent.",0,
0,0,GET_NO_ARG,NO_ARG,'s',0,0,0,0,0,0},
{"sort-index",
0,0,GET_NO_ARG,NO_ARG,0,0,0,0,0,0},
{"sort-index",'S',
"Sort index blocks. This speeds up 'read-next' in applications.",0,0,0,
GET_NO_ARG,NO_ARG,'S',0,0,0,0,0,0},
{"sort-records",
GET_NO_ARG,NO_ARG,0,0,0,0,0,0},
{"sort-records",'R',
"Sort records according to an index. This makes your data much more localized and may speed up things. (It may be VERY slow to do a sort the first time!)",