mysql supports the following options, which can be specified on the command line or in the mysql支持以下选项,可以在命令行或选项文件的[mysql]
and [client]
groups of an option file. [mysql]
和[client]
组中指定。For information about option files used by MySQL programs, see Section 4.2.2.2, “Using Option Files”.有关MySQL程序使用的选项文件的信息,请参阅第4.2.2.2节,“使用选项文件”。
Table 4.11 mysql Client Optionsmysql客户端选项
--auto-rehash | |||
---|---|---|---|
--auto-vertical-output | |||
--batch | |||
--binary-as-hex | |||
--binary-mode | |||
--bind-address | |||
--character-sets-dir | |||
--column-names | |||
--column-type-info | |||
--comments | |||
--compress | 8.0.18 | ||
--compression-algorithms | 8.0.18 | ||
--connect-expired-password | |||
--connect-timeout | |||
--database | |||
--debug | |||
--debug-check | |||
--debug-info | |||
--default-auth | |||
--default-character-set | |||
--defaults-extra-file | |||
--defaults-file | |||
--defaults-group-suffix | |||
--delimiter | |||
--dns-srv-name | 8.0.22 | ||
--enable-cleartext-plugin | |||
--execute | |||
--force | |||
--get-server-public-key | |||
--help | |||
--histignore | |||
--host | |||
--html | |||
--ignore-spaces | |||
--init-command | |||
--line-numbers | |||
--load-data-local-dir | 8.0.21 | ||
--local-infile | |||
--login-path | |||
--max-allowed-packet | |||
--max-join-size | |||
--named-commands | |||
--net-buffer-length | |||
--network-namespace | 8.0.22 | ||
--no-auto-rehash | |||
--no-beep | |||
--no-defaults | |||
--one-database | |||
--pager | |||
--password | |||
--pipe | |||
--plugin-dir | |||
--port | |||
--print-defaults | |||
--prompt | |||
--protocol | |||
--quick | |||
--raw | |||
--reconnect | |||
--safe-updates, --i-am-a-dummy | |||
--select-limit | |||
--server-public-key-path | |||
--shared-memory-base-name | |||
--show-warnings | |||
--sigint-ignore | |||
--silent | |||
--skip-auto-rehash | |||
--skip-column-names | |||
--skip-line-numbers | |||
--skip-named-commands | |||
--skip-pager | |||
--skip-reconnect | |||
--socket | |||
--ssl-ca | |||
--ssl-capath | |||
--ssl-cert | |||
--ssl-cipher | |||
--ssl-crl | |||
--ssl-crlpath | |||
--ssl-fips-mode | |||
--ssl-key | |||
--ssl-mode | |||
--syslog | |||
--table | |||
--tee | |||
--tls-ciphersuites | 8.0.16 | ||
--tls-version | |||
--unbuffered | |||
--user | |||
--verbose | |||
--version | |||
--vertical | |||
--wait | |||
--xml | |||
--zstd-compression-level | 8.0.18 |
--help
, -?
Display a help message and exit.显示帮助消息并退出。
Enable automatic rehashing. This option is on by default, which enables database, table, and column name completion. 启用自动重新清洗。默认情况下,此选项处于启用状态,这将启用数据库、表和列名完成。Use 使用--disable-auto-rehash
to disable rehashing. --disable-auto-rehash
来禁用rehash。That causes mysql to start faster, but you must issue the 这会使mysql启动得更快,但如果要使用名称补全,则必须发出rehash
command or its \#
shortcut if you want to use name completion.rehash
命令或其\#
快捷方式。
To complete a name, enter the first part and press Tab. If the name is unambiguous, mysql completes it. 要完成一个名称,请输入第一部分并按Tab键。如果名称明确,mysql会完成它。Otherwise, you can press Tab again to see the possible names that begin with what you have typed so far. Completion does not occur if there is no default database.否则,您可以再次按Tab键查看以您迄今为止键入的名称开头的可能名称。如果没有默认数据库,则不会完成。
This feature requires a MySQL client that is compiled with the readline library. 此功能需要使用readline库编译的MySQL客户端。Typically, the readline library is not available on Windows.通常,readline库在Windows上不可用。
Cause result sets to be displayed vertically if they are too wide for the current window, and using normal tabular format otherwise. 如果结果集对于当前窗口来说太宽,则导致结果集垂直显示,否则使用正常的表格格式。(This applies to statements terminated by (这适用于由;
or \G
.);
或\G
终止的声明。)
--batch
, -B
Print results using tab as the column separator, with each row on a new line. 使用制表符作为列分隔符打印结果,每行在新行上。With this option, mysql does not use the history file.使用此选项,mysql不使用历史文件。
Batch mode results in nontabular output format and escaping of special characters. 批处理模式会导致非异常的输出格式和特殊字符的转义。Escaping may be disabled by using raw mode; see the description for the 使用原始模式可以禁用逃逸;请参阅--raw
option.--raw
选项的说明。
When this option is given, mysql displays binary data using hexadecimal notation (当给出此选项时,mysql使用十六进制表示法(0x
). value
0xvalue
)显示二进制数据。This occurs whether the overall output display format is tabular, vertical, HTML, or XML.无论整体输出显示格式是表格、垂直、HTML还是XML,都会发生这种情况。
--binary-as-hex
when enabled affects display of all binary strings, including those returned by functions such as 启用时会影响所有二进制字符串的显示,包括CHAR()
and UNHEX()
. CHAR()
和UNHEX()
等函数返回的字符串。The following example demonistrates this using the ASCII code for 以下示例使用A
(65 decimal, 41 hexadecimal):A
的ASCII码(65十进制,41十六进制)证明了这一点:
--binary-as-hex
disabled:禁用:
mysql> SELECT CHAR(0x41), UNHEX('41');
+------------+-------------+
| CHAR(0x41) | UNHEX('41') |
+------------+-------------+
| A | A |
+------------+-------------+
--binary-as-hex
enabled:启用:
mysql> SELECT CHAR(0x41), UNHEX('41');
+------------------------+--------------------------+
| CHAR(0x41) | UNHEX('41') |
+------------------------+--------------------------+
| 0x41 | 0x41 |
+------------------------+--------------------------+
To write a binary string expression so that it displays as a character string regardless of whether 要编写二进制字符串表达式,使其无论是否启用--binary-as-hex
is enabled, use these techniques:--binary-as-hex
都显示为字符串,请使用以下技术:
The CHAR()
function has a USING
clause:charset
CHAR()
函数有一个USING charset
子句:
mysql> SELECT CHAR(0x41 USING utf8mb4);
+--------------------------+
| CHAR(0x41 USING utf8mb4) |
+--------------------------+
| A |
+--------------------------+
More generally, use 更一般地说,使用CONVERT()
to convert an expression to a given character set:CONVERT()
将表达式转换为给定的字符集:
mysql> SELECT CONVERT(UNHEX('41') USING utf8mb4);
+------------------------------------+
| CONVERT(UNHEX('41') USING utf8mb4) |
+------------------------------------+
| A |
+------------------------------------+
As of MySQL 8.0.19, when mysql operates in interactive mode, this option is enabled by default. 从MySQL 8.0.19开始,当mysql在交互模式下运行时,默认情况下启用此选项。In addition, output from the 此外,当隐式或显式启用该选项时,status
(or \s
) command includes this line when the option is enabled implicitly or explicitly:status
(或\s
)命令的输出包括此行:
Binary data as: Hexadecimal
To disable hexadecimal notation, use 要禁用十六进制表示法,请使用--skip-binary-as-hex
--skip-binary-as-hex
This option helps when processing mysqlbinlog output that may contain 此选项有助于处理可能包含BLOB
values. BLOB
值的mysqlbinlog输出。By default, mysql translates 默认情况下,mysql将语句字符串中的\r\n
in statement strings to \n
and interprets \0
as the statement terminator. \r\n
转换为\n
,并将\0
解释为语句终止符。--binary-mode
disables both features. --binary-mode
禁用这两个功能。It also disables all mysql commands except 它还在非交互模式下禁用除字符集和分隔符之外的所有mysql命令(用于通过管道传输到mysql或使用charset
and delimiter
in noninteractive mode (for input piped to mysql or loaded using the source
command).source
命令加载的输入)。
On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server.在具有多个网络接口的计算机上,使用此选项选择用于连接MySQL服务器的接口。
The directory where character sets are installed. See Section 10.15, “Character Set Configuration”.安装字符集的目录。参阅第10.15节,“字符集配置”。
Write column names in results.在结果中写入列名。
Display result set metadata. 显示结果集元数据。This information corresponds to the contents of C API 此信息对应于C API MYSQL_FIELD
data structures. See C API Basic Data Structures.MYSQL_FIELD
数据结构的内容。参见C API基础数据结构。
--comments
, -c
Whether to strip or preserve comments in statements sent to the server. 是否删除或保留发送到服务器的语句中的注释。The default is 默认设置为--skip-comments
(strip comments), enable with --comments
(preserve comments).--skip-comments
(删除注释),启用--comments
(保留注释)。
The mysql client always passes optimizer hints to the server, regardless of whether this option is given.mysql客户端始终将优化器提示传递给服务器,无论是否给出此选项。
Comment stripping is deprecated. Expect this feature and the options to control it to be removed in a future MySQL release.删除评论已被弃用。预计此功能及其控制选项将在未来的MySQL版本中删除。
--compress
, -C
Compress all information sent between the client and the server if possible. See Section 4.2.8, “Connection Compression Control”.如果可能的话,压缩客户端和服务器之间发送的所有信息。参阅第4.2.8节,“连接压缩控制”。
As of MySQL 8.0.18, this option is deprecated. Expect it be removed in a future version of MySQL. 从MySQL 8.0.18开始,此选项已被弃用。预计它将在MySQL的未来版本中删除。See Configuring Legacy Connection Compression.请参阅配置传统连接压缩。
--compression-algorithms=
value
The permitted compression algorithms for connections to the server. 允许用于连接到服务器的压缩算法。The available algorithms are the same as for the 可用的算法与protocol_compression_algorithms
system variable. protocol_compression_algorithms
系统变量的算法相同。The default value is 默认值为uncompressed
.uncompressed
。
For more information, see Section 4.2.8, “Connection Compression Control”.有关更多信息,请参阅第4.2.8节,“连接压缩控制”。
This option was added in MySQL 8.0.18.此选项是在MySQL 8.0.18中添加的。
Indicate to the server that the client can handle sandbox mode if the account used to connect has an expired password. 向服务器指示,如果用于连接的帐户密码已过期,则客户端可以处理沙盒模式。This can be useful for noninteractive invocations of mysql because normally the server disconnects noninteractive clients that attempt to connect using an account with an expired password. 这对于mysql的非交互式调用非常有用,因为通常服务器会断开尝试使用密码过期的帐户进行连接的非交互式客户端。(See Section 6.2.16, “Server Handling of Expired Passwords”.)(参阅第6.2.16节,“服务器处理过期密码”。)
The number of seconds before connection timeout. 连接超时前的秒数。(Default value is (默认值为0
.)0
。)
--database=
, db_name
-D
db_name
The database to use. This is useful primarily in an option file.要使用的数据库。这主要在选项文件中有用。
--debug[=
, debug_options
]-# [
debug_options
]
Write a debugging log. A typical 编写调试日志。典型的debug_options
string is d:t:o,
. The default is file_name
d:t:o,/tmp/mysql.trace
.debug_options
字符串是d:t:o,file_name
。默认值是d:t:o,/tmp/mysql.trace
。
This option is available only if MySQL was built using 仅当MySQL使用WITH_DEBUG
. MySQL release binaries provided by Oracle are not built using this option.WITH_DEBUG
构建时,此选项才可用。Oracle提供的MySQL发布二进制文件不是使用此选项构建的。
Print some debugging information when the program exits.程序退出时打印一些调试信息。
This option is available only if MySQL was built using 仅当MySQL使用WITH_DEBUG
. WITH_DEBUG
构建时,此选项才可用。MySQL release binaries provided by Oracle are not built using this option.Oracle提供的MySQL发布二进制文件不是使用此选项构建的。
--debug-info
, -T
Print debugging information and memory and CPU usage statistics when the program exits.程序退出时打印调试信息以及内存和CPU使用统计数据。
This option is available only if MySQL was built using 仅当MySQL使用WITH_DEBUG
. MySQL release binaries provided by Oracle are not built using this option.WITH_DEBUG
构建时,此选项才可用。Oracle提供的MySQL发布二进制文件不是使用此选项构建的。
A hint about which client-side authentication plugin to use. See Section 6.2.17, “Pluggable Authentication”.关于使用哪个客户端身份验证插件的提示。参阅第6.2.17节,“可插拔身份验证”。
--default-character-set=
charset_name
Use 使用charset_name
as the default character set for the client and connection.charset_name
作为客户端和连接的默认字符集。
This option can be useful if the operating system uses one character set and the mysql client by default uses another. 如果操作系统使用一个字符集,而mysql客户端默认使用另一个,则此选项可能很有用。In this case, output may be formatted incorrectly. You can usually fix such issues by using this option to force the client to use the system character set instead.在这种情况下,输出格式可能不正确。您通常可以通过使用此选项强制客户端使用系统字符集来解决此类问题。
For more information, see Section 10.4, “Connection Character Sets and Collations”, and Section 10.15, “Character Set Configuration”.有关更多信息,请参阅第10.4节,“连接字符集和排序规则”和第10.15节,“字符集配置”。
--defaults-extra-file=
file_name
Read this option file after the global option file but (on Unix) before the user option file. 在全局选项文件之后读取此选项文件,但(在Unix上)在用户选项文件之前读取。If the file does not exist or is otherwise inaccessible, an error occurs. If 如果文件不存在或无法访问,则会发生错误。如果file_name
is not an absolute path name, it is interpreted relative to the current directory.file_name
不是绝对路径名,则会相对于当前目录进行解释。
For additional information about this and other option-file options, see Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”.有关此选项和其他选项文件选项的更多信息,请参阅第4.2.2.3节,“影响选项文件处理的命令行选项”。
Use only the given option file. If the file does not exist or is otherwise inaccessible, an error occurs. If 仅使用给定的选项文件。如果文件不存在或无法访问,则会发生错误。如果file_name
is not an absolute path name, it is interpreted relative to the current directory.file_name
不是绝对路径名,则会相对于当前目录进行解释。
Exception: Even with 异常:即使使用--defaults-file
, client programs read .mylogin.cnf
.--defaults-file
,客户端程序也会读取mylogin.cnf
。
For additional information about this and other option-file options, see Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”.有关此选项和其他选项文件选项的更多信息,请参阅第4.2.2.3节,“影响选项文件处理的命令行选项”。
Read not only the usual option groups, but also groups with the usual names and a suffix of 不仅要读取常用的选项组,还要读取具有常用名称和后缀str
. str
的组。For example, mysql normally reads the 例如,mysql通常读取[client]
and [mysql]
groups. [client]
和[mysql]
组。If this option is given as 如果将此选项设置为--defaults-group-suffix=_other
, mysql also reads the [client_other]
and [mysql_other]
groups.--defaults-group-suffix=_other
,mysql还会读取[client_other]
和[mysql_other]
组。
For additional information about this and other option-file options, see Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”.有关此选项和其他选项文件选项的更多信息,请参阅第4.2.2.3节,“影响选项文件处理的命令行选项”。
Set the statement delimiter. The default is the semicolon character (设置语句分隔符。默认值是分号字符(;
).;
)。
Disable named commands. Use the 禁用命名命令。仅使用\*
form only, or use named commands only at the beginning of a line ending with a semicolon (;
). \*
表单,或仅在以分号(;
)结尾的行首使用命名命令。mysql starts with this option enabled by default. mysql默认启用此选项。However, even with this option, long-format commands still work from the first line. See Section 4.5.1.2, “mysql Client Commands”.但是,即使使用此选项,长格式命令仍然可以从第一行开始工作。请参阅第4.5.1.2节,“mysql客户端命令”。
Specifies the name of a DNS SRV record that determines the candidate hosts to use for establishing a connection to a MySQL server. 指定DNS SRV记录的名称,该记录确定用于建立与MySQL服务器连接的候选主机。For information about DNS SRV support in MySQL, see Section 4.2.6, “Connecting to the Server Using DNS SRV Records”.有关MySQL中DNS SRV支持的信息,请参阅第4.2.6节,“使用DNS SRV记录连接到服务器”。
Suppose that DNS is configured with this SRV information for the 假设DNS配置了example.com
domain:example.com
域的SRV信息:
Name TTL Class Priority Weight Port Target _mysql._tcp.example.com. 86400 IN SRV 0 5 3306 host1.example.com _mysql._tcp.example.com. 86400 IN SRV 0 10 3306 host2.example.com _mysql._tcp.example.com. 86400 IN SRV 10 5 3306 host3.example.com _mysql._tcp.example.com. 86400 IN SRV 20 5 3306 host4.example.com
To use that DNS SRV record, invoke mysql like this:要使用DNS SRV记录,请按如下方式调用mysql:
mysql --dns-srv-name=_mysql._tcp.example.com
mysql then attempts a connection to each server in the group until a successful connection is established. mysql然后尝试连接到组中的每个服务器,直到建立成功的连接。A failure to connect occurs only if a connection cannot be established to any of the servers. The priority and weight values in the DNS SRV record determine the order in which servers should be tried.仅当无法与任何服务器建立连接时,才会发生连接失败。DNS SRV记录中的优先级和权重值决定了尝试服务器的顺序。
When invoked with 当使用--dns-srv-name
, mysql attempts to establish TCP connections only.--dns-srv-name
调用时,mysql仅尝试建立TCP连接。
The 如果同时给出了--dns-srv-name
option takes precedence over the --host
option if both are given. --dns-srv-name
选项和--host
选项,则--dns-srv-name
选项优先于--host
选项。--dns-srv-name
causes connection establishment to use the mysql_real_connect_dns_srv()
C API function rather than mysql_real_connect()
. --dns-srv-name
导致连接建立使用mysql_real_connect_dns_srv()
C API函数,而不是mysql_real_connect()
。However, if the 但是,如果随后在运行时使用connect
command is subsequently used at runtime and specifies a host name argument, that host name takes precedence over any --dns-srv-name
option given at mysql startup to specify a DNS SRV record.connect
命令并指定主机名参数,则该主机名优先于mysql启动时给出的任何--dns-srv-name
选项,以指定DNS SRV记录。
This option was added in MySQL 8.0.22.此选项是在MySQL 8.0.22中添加的。
Enable the 启用mysql_clear_password
cleartext authentication plugin. (See Section 6.4.1.4, “Client-Side Cleartext Pluggable Authentication”.)mysql_clear_password
明文身份验证插件。(参阅第6.4.1.4节,“客户端明文可插拔身份验证”。)
--execute=
, statement
-e
statement
Execute the statement and quit. The default output format is like that produced with 执行该语句并退出。默认输出格式类似于使用--batch
. --batch
生成的格式。See Section 4.2.2.1, “Using Options on the Command Line”, for some examples. 有关一些示例,请参阅第4.2.2.1节,“使用命令行上的选项”。With this option, mysql does not use the history file.使用此选项,mysql不使用历史文件。
--force
, -f
Continue even if an SQL error occurs.即使发生SQL错误,也要继续。
Request from the server the public key required for RSA key pair-based password exchange. 从服务器请求基于RSA密钥对的密码交换所需的公钥。This option applies to clients that authenticate with the 此选项适用于使用caching_sha2_password
authentication plugin. caching_sha2_password
身份验证插件进行身份验证的客户端。For that plugin, the server does not send the public key unless requested. This option is ignored for accounts that do not authenticate with that plugin. 对于该插件,除非请求,否则服务器不会发送公钥。对于不使用该插件进行身份验证的帐户,此选项将被忽略。It is also ignored if RSA-based password exchange is not used, as is the case when the client connects to the server using a secure connection.如果不使用基于RSA的密码交换,它也会被忽略,就像客户端使用安全连接连接到服务器的情况一样。
If 如果给定了--server-public-key-path=
is given and specifies a valid public key file, it takes precedence over file_name
--get-server-public-key
.--server-public-key-path=file_name
并指定了一个有效的公钥文件,则它优先于--get-server-public-key
。
For information about the 有关caching_sha2_password
plugin, see Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”.caching_sha2_password
插件的信息,请参阅第6.4.1.2节,“缓存SHA-2可插拔身份验证”。
A list of one or more colon-separated patterns specifying statements to ignore for logging purposes. 一个或多个以冒号分隔的模式列表,指定了用于日志记录的忽略语句。These patterns are added to the default pattern list (这些模式将添加到默认模式列表中("*IDENTIFIED*:*PASSWORD*"
). "*IDENTIFIED*:*PASSWORD*"
)。The value specified for this option affects logging of statements written to the history file, and to 为此选项指定的值会影响写入历史文件的语句的日志记录,如果给出了syslog
if the --syslog
option is given. --syslog
选项,则会影响写入syslog
的语句的记录。For more information, see Section 4.5.1.3, “mysql Client Logging”.有关更多信息,请参阅第4.5.1.3节,“mysql客户端日志记录”。
--host=
, host_name
-h
host_name
Connect to the MySQL server on the given host.连接到给定主机上的MySQL服务器。
The 如果同时给出了--dns-srv-name
option takes precedence over the --host
option if both are given. --dns-srv-name
选项和--host
选项,则--dns-srv-name
选项优先于--host选项。--dns-srv-name
causes connection establishment to use the mysql_real_connect_dns_srv()
C API function rather than mysql_real_connect()
. --dns-srv-name
导致连接建立使用mysql_real_connect_dns_srv()
C API函数,而不是mysql_real_connect()
。However, if the 但是,如果随后在运行时使用connect
command is subsequently used at runtime and specifies a host name argument, that host name takes precedence over any --dns-srv-name
option given at mysql startup to specify a DNS SRV record.connect
命令并指定主机名参数,则该主机名优先于mysql启动时给出的任何--dns-srv-name
选项,以指定dns srv记录。
--html
, -H
Produce HTML output.生成HTML输出。
--ignore-spaces
, -i
Ignore spaces after function names. The effect of this is described in the discussion for the 忽略函数名称后的空格。IGNORE_SPACE
SQL mode (see Section 5.1.11, “Server SQL Modes”).IGNORE_SPACE
SQL模式的讨论中描述了其效果(参阅第5.1.11节,“服务器SQL模式”)。
SQL statement to execute after connecting to the server. If auto-reconnect is enabled, the statement is executed again after reconnection occurs.连接到服务器后要执行的SQL语句。如果启用了自动重新连接,则会在重新连接后再次执行该语句。
Write line numbers for errors. Disable this with 写下错误的行号。使用--skip-line-numbers
.--skip-line-numbers
禁用此功能。
--load-data-local-dir=
dir_name
This option affects the client-side 此选项影响客户端LOCAL
capability for LOAD DATA
operations. LOAD DATA
操作的LOCAL
功能。It specifies the directory in which files named in 它指定了LOAD DATA LOCAL
statements must be located. LOAD DATA LOCAL
语句中命名的文件必须位于的目录。The effect of --load-data-local-dir
depends on whether LOCAL
data loading is enabled or disabled:--load-data-local-dir
的效果取决于是启用还是禁用LOCAL
数据加载:
If 如果默认情况下在MySQL客户端库中或通过指定LOCAL
data loading is enabled, either by default in the MySQL client library or by specifying --local-infile[=1]
, the --load-data-local-dir
option is ignored.--local-infile[=1]
启用了LOCAL
数据加载,则--load-data-local-dir
选项将被忽略。
If 如果MySQL客户端库中默认或通过指定LOCAL
data loading is disabled, either by default in the MySQL client library or by specifying --local-infile=0
, the --load-data-local-dir
option applies.--local-infile=0
禁用LOCAL数据加载,则应用--load-data-local-dir
选项。
When 当应用--load-data-local-dir
applies, the option value designates the directory in which local data files must be located. --load-data-local-dir
时,选项值指定本地数据文件必须位于其中的目录。Comparison of the directory path name and the path name of files to be loaded is case-sensitive regardless of the case sensitivity of the underlying file system. 无论底层文件系统的大小写敏感性如何,目录路径名和要加载的文件的路径名的比较都是区分大小写的。If the option value is the empty string, it names no directory, with the result that no files are permitted for local data loading.如果选项值为空字符串,则不命名目录,结果是不允许本地数据加载任何文件。
For example, to explicitly disable local data loading except for files located in the 例如,要显式禁用本地数据加载,但位于/my/local/data
directory, invoke mysql like this:/my/local/data
目录中的文件除外,请按如下方式调用mysql:
mysql --local-infile=0 --load-data-local-dir=/my/local/data
When both 当同时给出--local-infile
and --load-data-local-dir
are given, the order in which they are given does not matter.--local-infile
和--load-data-local-dir
时,给出它们的顺序并不重要。
Successful use of 在mysql中成功使用LOCAL
load operations within mysql also requires that the server permits local loading; see Section 6.1.6, “Security Considerations for LOAD DATA LOCAL”LOCAL
加载操作还需要服务器允许本地加载;参阅第6.1.6节,“本地加载数据的安全考虑”。
The --load-data-local-dir
option was added in MySQL 8.0.21.--load-data-local-dir
选项是在MySQL 8.0.21中添加的。
By default, 默认情况下,LOCAL
capability for LOAD DATA
is determined by the default compiled into the MySQL client library. LOAD DATA
的LOCAL
功能由编译到MySQL客户端库中的默认值决定。To enable or disable 要显式启用或禁用LOCAL
data loading explicitly, use the --local-infile
option. LOCAL
数据加载,请使用--local-infile
选项。When given with no value, the option enables 当没有值时,该选项启用LOCAL
data loading. LOCAL
数据加载。When given as 当给定--local-infile=0
or --local-infile=1
, the option disables or enables LOCAL
data loading.--local-infile=0
或--local-infile=1
时,该选项将禁用或启用LOCAL
数据加载。
If 如果禁用LOCAL
capability is disabled, the --load-data-local-dir
option can be used to permit restricted local loading of files located in a designated directory.LOCAL
功能,则可以使用--load-data-local-dir
选项来允许对指定目录中的文件进行受限的本地加载。
Successful use of 在mysql中成功使用LOCAL
load operations within mysql also requires that the server permits local loading; see Section 6.1.6, “Security Considerations for LOAD DATA LOCAL”LOCAL
加载操作还需要服务器允许本地加载;参阅第6.1.6节,“本地加载数据的安全考虑”。
Read options from the named login path in the 从.mylogin.cnf
login path file. .mylogin.cnf
登录路径文件中的指定登录路径读取选项。A “login path” is an option group containing options that specify which MySQL server to connect to and which account to authenticate as. “登录路径”是一个选项组,其中包含指定要连接到哪个MySQL服务器以及要作为哪个帐户进行身份验证的选项。To create or modify a login path file, use the mysql_config_editor utility. 要创建或修改登录路径文件,请使用mysql_config_editor实用程序。See Section 4.6.7, “mysql_config_editor — MySQL Configuration Utility”.请参阅第4.6.7节,“mysql_config编辑器--mysql配置实用程序”。
For additional information about this and other option-file options, see Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”.有关此选项和其他选项文件选项的更多信息,请参阅第4.2.2.3节,“影响选项文件处理的命令行选项”。
The maximum size of the buffer for client/server communication. The default is 16MB, the maximum is 1GB.客户端/服务器通信的最大缓冲区大小。默认值为16MB,最大值为1GB。
The automatic limit for rows in a join when using 使用--safe-updates
. (Default value is 1,000,000.)--safe-updates
时对连接中的行的自动限制。(默认值为1000000。)
--named-commands
, -G
Enable named mysql commands. Long-format commands are permitted, not just short-format commands. 启用命名mysql命令。允许使用长格式命令,而不仅仅是短格式命令。For example, 例如,quit
and \q
both are recognized. Use --skip-named-commands
to disable named commands. quit
和\q
都被识别。使用--skip-named-commands
禁用命名命令。See Section 4.5.1.2, “mysql Client Commands”.请参阅第4.5.1.2节,“mysql客户端命令”。
The buffer size for TCP/IP and socket communication. (Default value is 16KB.)TCP/IP和套接字通信的缓冲区大小。(默认值为16KB。)
The network namespace to use for TCP/IP connections. If omitted, the connection uses the default (global) namespace. For information about network namespaces, see Section 5.1.14, “Network Namespace Support”.用于TCP/IP连接的网络命名空间。如果省略,连接将使用默认(全局)命名空间。有关网络命名空间的信息,请参阅第5.1.14节,“网络命名空间支持”。
This option was added in MySQL 8.0.22. It is available only on platforms that implement network namespace support.此选项是在MySQL 8.0.22中添加的。它仅在实现网络命名空间支持的平台上可用。
--no-auto-rehash
, -A
This has the same effect as 这与--skip-auto-rehash
. See the description for --auto-rehash
.--skip-auto-rehash
具有相同的效果。请参阅--auto-rehash
的说明。
--no-beep
, -b
Do not beep when errors occur.发生错误时不要发出蜂鸣声。
Do not read any option files. If program startup fails due to reading unknown options from an option file, 不要读取任何选项文件。如果程序启动因从选项文件中读取未知选项而失败,则使用--no-defaults
can be used to prevent them from being read.--no-defaults
可以阻止读取它们。
The exception is that the 例外的是,.mylogin.cnf
file is read in all cases, if it exists. .mylogin.cnf
文件在所有情况下都会被读取(如果存在的话)。This permits passwords to be specified in a safer way than on the command line even when 这允许以比命令行更安全的方式指定密码,即使使用--no-defaults
is used. --no-defaults
。To create 要创建.mylogin.cnf
, use the mysql_config_editor utility. .mylogin.cnf
,请使用mysql_config_editor实用程序。See Section 4.6.7, “mysql_config_editor — MySQL Configuration Utility”.请参阅第4.6.7节,“mysql_config编辑器--mysql配置实用程序”。
For additional information about this and other option-file options, see Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”.有关此选项和其他选项文件选项的更多信息,请参阅第4.2.2.3节,“影响选项文件处理的命令行选项”。
--one-database
, -o
Ignore statements except those that occur while the default database is the one named on the command line. 忽略语句,除非默认数据库是命令行上指定的数据库。This option is rudimentary and should be used with care. Statement filtering is based only on 此选项尚处于初级阶段,应谨慎使用。语句筛选仅基于USE
statements.USE
语句。
Initially, mysql executes statements in the input because specifying a database 最初,mysql在输入中执行语句,因为在命令行上指定数据库db_name
on the command line is equivalent to inserting USE
at the beginning of the input. db_name
db_name
相当于在输入的开头插入USE db_name
。Then, for each 然后,对于遇到的每个USE
statement encountered, mysql accepts or rejects following statements depending on whether the database named is the one on the command line. USE
语句,mysql接受或拒绝以下语句,具体取决于指定的数据库是否是命令行上的数据库。The content of the statements is immaterial.声明的内容无关紧要。
Suppose that mysql is invoked to process this set of statements:假设调用mysql来处理这组语句:
DELETE FROM db2.t2; USE db2; DROP TABLE db1.t1; CREATE TABLE db1.t1 (i INT); USE db1; INSERT INTO t1 (i) VALUES(1); CREATE TABLE db2.t1 (j INT);
If the command line is mysql --force --one-database db1, mysql handles the input as follows:如果命令行是mysql --force --one-database db1,mysql将按如下方式处理输入:
The 执行DELETE
statement is executed because the default database is db1
, even though the statement names a table in a different database.DELETE
语句是因为默认数据库是db1
,即使该语句命名了不同数据库中的表。
The DROP TABLE
and CREATE TABLE
statements are not executed because the default database is not db1
, even though the statements name a table in db1
.DROP TABLE
和CREATE TABLE
语句不会执行,因为默认数据库不是db1
,即使这些语句在db1
中命名了一个表。
The 执行INSERT
and CREATE TABLE
statements are executed because the default database is db1
, even though the CREATE TABLE
statement names a table in a different database.INSERT
和CREATE TABLE
语句是因为默认数据库是db1,即使CREATE TABLE
语句在不同的数据库中命名了一个表。
Use the given command for paging query output. 使用给定的命令进行分页查询输出。If the command is omitted, the default pager is the value of your 如果省略该命令,则默认分页器是pager环境变量的值。PAGER
environment variable. Valid pagers are less, more, cat [> filename], and so forth. 有效的寻呼机有更少、更多、cat[>filename]
等等。This option works only on Unix and only in interactive mode. 此选项仅在Unix和交互模式下有效。To disable paging, use 要禁用分页,请使用--skip-pager
. Section 4.5.1.2, “mysql Client Commands”, discusses output paging further.--skip-pager
。第4.5.1.2节,“mysql客户端命令”进一步讨论了输出分页。
--password[=
, password
]-p[
password
]
The password of the MySQL account used for connecting to the server. The password value is optional. 用于连接到服务器的MySQL帐户的密码。密码值是可选的。If not given, mysql prompts for one. 如果没有给出,mysql会提示输入一个。If given, there must be no space between 如果给定,则--password=
or -p
and the password following it. --password=
或-p
与后面的密码之间不得有空格。If no password option is specified, the default is to send no password.如果未指定密码选项,则默认为不发送密码。
Specifying a password on the command line should be considered insecure. To avoid giving the password on the command line, use an option file. See Section 6.1.2.1, “End-User Guidelines for Password Security”.在命令行上指定密码应被视为不安全。为了避免在命令行上输入密码,请使用选项文件。请参阅第6.1.2.1节,“密码安全最终用户指南”。
To explicitly specify that there is no password and that mysql should not prompt for one, use the 要明确指定没有密码并且mysql不应提示输入密码,请使用--skip-password
option.--skip-password
选项。
--pipe
, -W
On Windows, connect to the server using a named pipe. 在Windows上,使用命名管道连接到服务器。This option applies only if the server was started with the 仅当服务器启动时启用了named_pipe
system variable enabled to support named-pipe connections. named_pipe
系统变量以支持命名管道连接时,此选项才适用。In addition, the user making the connection must be a member of the Windows group specified by the 此外,进行连接的用户必须是named_pipe_full_access_group
system variable.named_pipe_full_access_group
系统变量指定的Windows组的成员。
The directory in which to look for plugins. Specify this option if the 查找插件的目录。如果使用--default-auth
option is used to specify an authentication plugin but mysql does not find it. --default-auth
选项指定身份验证插件,但mysql找不到它,请指定此选项。See Section 6.2.17, “Pluggable Authentication”.请参阅第6.2.17节,“可插拔身份验证”。
--port=
, port_num
-P
port_num
For TCP/IP connections, the port number to use.对于TCP/IP连接,要使用的端口号。
Print the program name and all options that it gets from option files.打印程序名称及其从选项文件中获取的所有选项。
For additional information about this and other option-file options, see Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”.有关此选项和其他选项文件选项的更多信息,请参阅第4.2.2.3节,“影响选项文件处理的命令行选项”。
Set the prompt to the specified format. 将提示设置为指定格式。The default is 默认设置为mysql>
. The special sequences that the prompt can contain are described in Section 4.5.1.2, “mysql Client Commands”.mysql>
。提示可以包含的特殊序列在第4.5.1.2节,“mysql客户端命令”中进行了描述。
--protocol={TCP|SOCKET|PIPE|MEMORY}
The transport protocol to use for connecting to the server. 用于连接到服务器的传输协议。It is useful when the other connection parameters normally result in use of a protocol other than the one you want. 当其他连接参数通常导致使用与您想要的协议不同的协议时,它很有用。For details on the permissible values, see Section 4.2.7, “Connection Transport Protocols”.有关允许值的详细信息,请参阅第4.2.7节,“连接传输协议”。
--quick
, -q
Do not cache each query result, print each row as it is received. This may slow down the server if the output is suspended. 不要缓存每个查询结果,在收到每一行时打印。如果输出暂停,这可能会减慢服务器的速度。With this option, mysql does not use the history file.使用此选项,mysql不使用历史文件。
--raw
, -r
For tabular output, the “boxing” around columns enables one column value to be distinguished from another. 对于表格输出,围绕列的“装箱”使一列值与另一列值区分开来。For nontabular output (such as is produced in batch mode or when the 对于非异常输出(例如在批处理模式下或给出--batch
or --silent
option is given), special characters are escaped in the output so they can be identified easily. --batch
或--silent
选项时产生的输出),输出中会转义特殊字符,以便轻松识别。Newline, tab, 换行符、制表符、NUL和反斜杠分别写为NUL
, and backslash are written as \n
, \t
, \0
, and \\
. \n
、\t
、\0
和\\
。The --raw
option disables this character escaping.--raw
选项禁用此字符转义。
The following example demonstrates tabular versus nontabular output and the use of raw mode to disable escaping:以下示例演示了表格输出与非表格输出以及使用原始模式禁用转义:
%mysql
mysql> SELECT CHAR(92); +----------+ | CHAR(92) | +----------+ | \ | +----------+ %mysql -s
mysql> SELECT CHAR(92); CHAR(92) \\ %mysql -s -r
mysql> SELECT CHAR(92); CHAR(92) \
If the connection to the server is lost, automatically try to reconnect. 如果与服务器的连接丢失,请自动尝试重新连接。A single reconnect attempt is made each time the connection is lost. 每次连接丢失时,都会进行一次重新连接尝试。To suppress reconnection behavior, use 要抑制重新连接行为,请使用--skip-reconnect
.--skip-reconnect
。
--safe-updates
, --i-am-a-dummy
, -U
If this option is enabled, 如果启用此选项,则不在UPDATE
and DELETE
statements that do not use a key in the WHERE
clause or a LIMIT
clause produce an error. WHERE
子句或LIMIT
子句中使用键的UPDATE
和DELETE
语句将产生错误。In addition, restrictions are placed on 此外,对产生(或估计会产生)非常大的结果集的SELECT语句施加了限制。SELECT
statements that produce (or are estimated to produce) very large result sets. If you have set this option in an option file, you can use 如果在选项文件中设置了此选项,则可以在命令行上使用--skip-safe-updates
on the command line to override it. --skip-safe-updates
来覆盖它。For more information about this option, see Using Safe-Updates Mode (--safe-updates).有关此选项的更多信息,请参阅使用安全更新模式(--Safe-Updates)。
The automatic limit for 使用SELECT
statements when using --safe-updates
. (Default value is 1,000.)--safe-updates
时SELECT
语句的自动限制。(默认值为1000。)
--server-public-key-path=
file_name
The path name to a file in PEM format containing a client-side copy of the public key required by the server for RSA key pair-based password exchange. PEM格式文件的路径名,该文件包含服务器基于RSA密钥对进行密码交换所需的公钥客户端副本。This option applies to clients that authenticate with the 此选项适用于使用sha256_password
or caching_sha2_password
authentication plugin. sha256_password
或caching_sha2_password
身份验证插件进行身份验证的客户端。This option is ignored for accounts that do not authenticate with one of those plugins. 对于未使用这些插件之一进行身份验证的帐户,此选项将被忽略。It is also ignored if RSA-based password exchange is not used, as is the case when the client connects to the server using a secure connection.如果不使用基于RSA的密码交换,它也会被忽略,就像客户端使用安全连接连接到服务器的情况一样。
If 如果给定了--server-public-key-path=
is given and specifies a valid public key file, it takes precedence over file_name
--get-server-public-key
.--server-public-key-path=file_name
并指定了一个有效的公钥文件,则它优先于--get-server-public-key
。
For 对于sha256_password
, this option applies only if MySQL was built using OpenSSL.sha256_password
,此选项仅适用于使用OpenSSL构建MySQL的情况。
For information about the 有关sha256_password
and caching_sha2_password
plugins, see Section 6.4.1.3, “SHA-256 Pluggable Authentication”, and Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”.sha256_password
和caching_sha2_password
插件的信息,请参阅第6.4.1.3节,“SHA-256可插拔身份验证”和第6.4.1.2节,“缓存SHA-2可插拔身份认证”。
--shared-memory-base-name=
name
On Windows, the shared-memory name to use for connections made using shared memory to a local server. The default value is 在Windows上,用于使用共享内存连接到本地服务器的共享内存名称。默认值为MYSQL
. The shared-memory name is case-sensitive.MYSQL
。共享内存名称区分大小写。
This option applies only if the server was started with the 此选项仅适用于服务器启动时启用了shared_memory
system variable enabled to support shared-memory connections.shared_memory
系统变量以支持共享内存连接的情况。
Cause warnings to be shown after each statement if there are any. This option applies to interactive and batch mode.如果有的话,在每个声明后显示警告。此选项适用于交互式和批处理模式。
Ignore 忽略SIGINT
signals (typically the result of typing Control+C).SIGINT
信号(通常是键入Control+C的结果)。
Without this option, typing Control+C interrupts the current statement if there is one, or cancels any partial input line otherwise.如果没有此选项,键入Control+C会中断当前语句(如果有),否则会取消任何部分输入行。
--silent
, -s
Silent mode. Produce less output. This option can be given multiple times to produce less and less output.静音模式。减少产量。此选项可以多次给出,以产生越来越少的输出。
This option results in nontabular output format and escaping of special characters. Escaping may be disabled by using raw mode; see the description for the 此选项会导致非异常的输出格式和特殊字符的转义。使用原始模式可以禁用逃逸;请参阅--raw
option.--raw
选项的说明。
Do not write column names in results.不要在结果中写入列名。
Do not write line numbers for errors. Useful when you want to compare result files that include error messages.不要为错误写行号。当您想要比较包含错误消息的结果文件时非常有用。
--socket=
, path
-S
path
For connections to 对于与localhost
, the Unix socket file to use, or, on Windows, the name of the named pipe to use.localhost
的连接,使用Unix套接字文件,或者在Windows上,使用命名管道的名称。
On Windows, this option applies only if the server was started with the 在Windows上,此选项仅在服务器启动时启用了named_pipe
system variable enabled to support named-pipe connections. named_pipe
系统变量以支持命名管道连接时适用。In addition, the user making the connection must be a member of the Windows group specified by the 此外,进行连接的用户必须是named_pipe_full_access_group
system variable.named_pipe_full_access_group
系统变量指定的Windows组的成员。
Options that begin with 以--ssl
specify whether to connect to the server using encryption and indicate where to find SSL keys and certificates. See Command Options for Encrypted Connections.--ssl
开头的选项指定是否使用加密连接到服务器,并指示在哪里查找ssl密钥和证书。请参见加密连接的命令选项。
--ssl-fips-mode={OFF|ON|STRICT}
Controls whether to enable FIPS mode on the client side. 控制是否在客户端启用FIPS模式。The --ssl-fips-mode
option differs from other --ssl-
options in that it is not used to establish encrypted connections, but rather to affect which cryptographic operations to permit. xxx
--ssl-fips-mode
选项与其他--ssl-xxx
选项的不同之处在于,它不用于建立加密连接,而是影响允许的加密操作。See Section 6.8, “FIPS Support”.请参阅第6.8节,“FIPS支持”。
These 允许使用以下--ssl-fips-mode
values are permitted:--ssl-fips-mode
值:
OFF
: Disable FIPS mode.:禁用FIPS模式。
ON
: Enable FIPS mode.:启用FIPS模式。
STRICT
: Enable “strict” FIPS mode.:启用“严格”FIPS模式。
If the OpenSSL FIPS Object Module is not available, the only permitted value for 如果OpenSSL FIPS对象模块不可用,则--ssl-fips-mode
is OFF
. --ssl-fips-mode
的唯一允许值为OFF
。In this case, setting 在这种情况下,将--ssl-fips-mode
to ON
or STRICT
causes the client to produce a warning at startup and to operate in non-FIPS mode.--ssl-fips-mode
设置为ON
或STRICT
会导致客户端在启动时产生警告,并在非fips模式下运行。
--syslog
, -j
This option causes mysql to send interactive statements to the system logging facility. 此选项使mysql向系统日志记录工具发送交互式语句。On Unix, this is 在Unix上,这是syslog
; on Windows, it is the Windows Event Log. The destination where logged messages appear is system dependent. syslog
;在Windows上,它是Windows事件日志。显示记录消息的目标取决于系统。On Linux, the destination is often the 在Linux上,目标通常是/var/log/messages
file./var/log/messages
文件。
Here is a sample of output generated on Linux by using 以下是在Linux上使用--syslog
. This output is formatted for readability; each logged message actually takes a single line.--syslog
生成的输出示例。此输出的格式是为了可读性;每条记录的消息实际上只需要一行。
Mar 7 12:39:25 myhost MysqlClient[20824]: SYSTEM_USER:'oscar', MYSQL_USER:'my_oscar', CONNECTION_ID:23, DB_SERVER:'127.0.0.1', DB:'--', QUERY:'USE test;' Mar 7 12:39:28 myhost MysqlClient[20824]: SYSTEM_USER:'oscar', MYSQL_USER:'my_oscar', CONNECTION_ID:23, DB_SERVER:'127.0.0.1', DB:'test', QUERY:'SHOW TABLES;'
For more information, see Section 4.5.1.3, “mysql Client Logging”.有关更多信息,请参阅第4.5.1.3节,“mysql客户端日志记录”。
--table
, -t
Display output in table format. This is the default for interactive use, but can be used to produce table output in batch mode.以表格形式显示输出。这是交互式使用的默认设置,但可用于在批处理模式下生成表输出。
Append a copy of output to the given file. This option works only in interactive mode. Section 4.5.1.2, “mysql Client Commands”, discusses tee files further.将输出的副本附加到给定的文件中。此选项仅在交互模式下有效。第4.5.1.2节,“mysql客户端命令”进一步讨论了tee文件。
--tls-ciphersuites=
ciphersuite_list
The permissible ciphersuites for encrypted connections that use TLSv1.3. The value is a list of one or more colon-separated ciphersuite names. 允许的密码适用于使用TLSv1.3的加密连接。该值是一个或多个冒号分隔的密码套件名称的列表。The ciphersuites that can be named for this option depend on the SSL library used to compile MySQL. 可以为此选项命名的密码套件取决于用于编译MySQL的SSL库。For details, see Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”.有关详细信息,请参阅第6.3.2节,“加密连接TLS协议和密码”。
This option was added in MySQL 8.0.16.此选项是在MySQL 8.0.16中添加的。
The permissible TLS protocols for encrypted connections. The value is a list of one or more comma-separated protocol names. 加密连接的允许TLS协议。该值是一个或多个逗号分隔的协议名称的列表。The protocols that can be named for this option depend on the SSL library used to compile MySQL. 可以为此选项命名的协议取决于用于编译MySQL的SSL库。For details, see Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”.有关详细信息,请参阅第6.3.2节,“加密连接TLS协议和密码”。
--unbuffered
, -n
Flush the buffer after each query.每次查询后刷新缓冲区。
--user=
, user_name
-u
user_name
The user name of the MySQL account to use for connecting to the server.用于连接到服务器的MySQL帐户的用户名。
--verbose
, -v
Verbose mode. Produce more output about what the program does. This option can be given multiple times to produce more and more output. (For example, 详细模式。生成更多关于程序功能的输出。可以多次给出此选项以产生越来越多的输出。(例如,-v -v -v
produces table output format even in batch mode.)-v -v -v
即使在批处理模式下也会生成表输出格式。)
--version
, -V
Display version information and exit.显示版本信息并退出。
--vertical
, -E
Print query output rows vertically (one line per column value). Without this option, you can specify vertical output for individual statements by terminating them with 垂直打印查询输出行(每列值一行)。如果没有此选项,您可以通过用\G
.\G
终止单个语句来为其指定垂直输出。
--wait
, -w
If the connection cannot be established, wait and retry instead of aborting.如果无法建立连接,请等待并重试,而不是中止。
--xml
, -X
Produce XML output.生成XML输出。
<field name="column_name
">NULL</field>
The output when 当--xml
is used with mysql matches that of mysqldump --xml
. --xml
与mysql一起使用时,输出与mysqldump --xml
的输出相匹配。See Section 4.5.4, “mysqldump — A Database Backup Program”, for details.有关详细信息,请参阅第4.5.4节,“mysqldump——数据库备份程序”。
The XML output also uses an XML namespace, as shown here:XML输出还使用XML名称空间,如下所示:
shell> mysql --xml -uroot -e "SHOW VARIABLES LIKE 'version%'"
<?xml version="1.0"?>
<resultset statement="SHOW VARIABLES LIKE 'version%'" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<row>
<field name="Variable_name">version</field>
<field name="Value">5.0.40-debug</field>
</row>
<row>
<field name="Variable_name">version_comment</field>
<field name="Value">Source distribution</field>
</row>
<row>
<field name="Variable_name">version_compile_machine</field>
<field name="Value">i686</field>
</row>
<row>
<field name="Variable_name">version_compile_os</field>
<field name="Value">suse-linux-gnu</field>
</row>
</resultset>
--zstd-compression-level=
level
The compression level to use for connections to the server that use the 用于连接到使用zstd
compression algorithm. zstd
压缩算法的服务器的压缩级别。The permitted levels are from 1 to 22, with larger values indicating increasing levels of compression. 允许的级别为1到22,较大的值表示压缩级别增加。The default 默认的zstd
compression level is 3. zstd
压缩级别为3。The compression level setting has no effect on connections that do not use 压缩级别设置对不使用zstd
compression.zstd
压缩的连接没有影响。
For more information, see Section 4.2.8, “Connection Compression Control”.有关更多信息,请参阅第4.2.8节,“连接压缩控制”。
This option was added in MySQL 8.0.18.此选项是在MySQL 8.0.18中添加的。