4.2.2.4 Program Option Modifiers程序选项修改器

Some options are boolean and control behavior that can be turned on or off. 一些选项是“布尔”的,可以打开或关闭控制行为。For example, the mysql client supports a --column-names option that determines whether or not to display a row of column names at the beginning of query results. 例如,mysql客户端支持--column-names选项,该选项决定是否在查询结果的开头显示一行列名。By default, this option is enabled. However, you may want to disable it in some instances, such as when sending the output of mysql into another program that expects to see only data and not an initial header line.默认情况下,此选项处于启用状态。但是,在某些情况下,您可能希望禁用它,例如当将mysql的输出发送到另一个只希望看到数据而不希望看到初始标题行的程序时。

To disable column names, you can specify the option using any of these forms:要禁用列名,您可以使用以下任何形式指定选项:

--disable-column-names
--skip-column-names
--column-names=0

The --disable and --skip prefixes and the =0 suffix all have the same effect: They turn the option off.--disable--skip前缀以及=0后缀都具有相同的效果:它们关闭了该选项。

The enabled form of the option may be specified in any of these ways:选项的“启用”形式可以通过以下任何一种方式指定:

--column-names
--enable-column-names
--column-names=1

The values ON, TRUE, OFF, and FALSE are also recognized for boolean options (not case-sensitive).布尔选项也可以识别ONTRUEOFFFALSE值(不区分大小写)。

If an option is prefixed by --loose, a program does not exit with an error if it does not recognize the option, but instead issues only a warning:如果一个选项的前缀是--loose,如果程序无法识别该选项,它不会退出并出错,而是只发出警告:

shell> mysql --loose-no-such-option
mysql: WARNING: unknown option '--loose-no-such-option'

The --loose prefix can be useful when you run programs from multiple installations of MySQL on the same machine and list options in an option file. 当您在同一台机器上运行多个MySQL安装的程序并在选项文件中列出选项时,--loose前缀可能很有用。An option that may not be recognized by all versions of a program can be given using the --loose prefix (or loose in an option file). 可以使用--loose前缀(或选项文件中的loose)给出可能无法被程序所有版本识别的选项。Versions of the program that recognize the option process it normally, and versions that do not recognize it issue a warning and ignore it.识别该选项的程序版本会正常处理它,而不识别它的版本会发出警告并忽略它。

The --maximum prefix is available for mysqld only and permits a limit to be placed on how large client programs can set session system variables. --maximum前缀仅适用于mysqld,并允许对大型客户端程序设置会话系统变量的数量进行限制。To do this, use a --maximum prefix with the variable name. For example, --maximum-max_heap_table_size=32M prevents any client from making the heap table size limit larger than 32M.为此,请在变量名前使用--maximum前缀。例如,--maximum-max_heap_table_size=32M可防止任何客户端使堆表大小限制大于32M。

The --maximum prefix is intended for use with system variables that have a session value. If applied to a system variable that has only a global value, an error occurs. --maximum前缀用于具有会话值的系统变量。如果应用于只有全局值的系统变量,则会发生错误。For example, with --maximum-back_log=200, the server produces this error:例如,当--maximum-back_log=200时,服务器会产生以下错误:

Maximum value of 'back_log' cannot be set