mysqlslap is a diagnostic program designed to emulate client load for a MySQL server and to report the timing of each stage. It works as if multiple clients are accessing the server.mysqlslap是一个诊断程序,旨在模拟MySQL服务器的客户端负载,并报告每个阶段的时间。它的工作方式就像多个客户端正在访问服务器一样。
Invoke mysqlslap like this:像这样调用mysqlslap:
mysqlslap [options
]
Some options such as 一些选项(如--create
or --query
enable you to specify a string containing an SQL statement or a file containing statements. --create
或--query
)使您能够指定包含SQL语句的字符串或包含语句的文件。If you specify a file, by default it must contain one statement per line. (That is, the implicit statement delimiter is the newline character.) 如果指定文件,默认情况下,每行必须包含一条语句。(也就是说,隐式语句分隔符是换行符。)Use the 使用--delimiter
option to specify a different delimiter, which enables you to specify statements that span multiple lines or place multiple statements on a single line. --delimiter
选项指定不同的分隔符,这使您能够指定跨多行的语句或将多个语句放在一行上。You cannot include comments in a file; mysqlslap does not understand them.您不能在文件中包含注释;mysqlslap不理解它们。
mysqlslap runs in three stages:mysqlslap分三个阶段运行:
Create schema, table, and optionally any stored programs or data to use for the test. This stage uses a single client connection.创建用于测试的模式、表以及任何存储的程序或数据(可选)。此阶段使用单个客户端连接。
Run the load test. This stage can use many client connections.运行负载测试。此阶段可以使用许多客户端连接。
Clean up (disconnect, drop table if specified). This stage uses a single client connection.清理(断开连接,如有规定,放下桌子)。此阶段使用单个客户端连接。
Examples:示例:
Supply your own create and query SQL statements, with 50 clients querying and 200 selects for each (enter the command on a single line):提供您自己的创建和查询SQL语句,每个语句有50个客户端查询和200个选择(在一行中输入命令):
mysqlslap --delimiter=";" --create="CREATE TABLE a (b int);INSERT INTO a VALUES (23)" --query="SELECT * FROM a" --concurrency=50 --iterations=200
Let mysqlslap build the query SQL statement with a table of two 让mysqlslap使用两个INT
columns and three VARCHAR
columns. INT
列和三个VARCHAR
列的表构建查询SQL语句。Use five clients querying 20 times each. Do not create the table or insert the data (that is, use the previous test's schema and data):使用五个客户端,每个客户端查询20次。不要创建表或插入数据(即使用前一个测试的架构和数据):
mysqlslap --concurrency=5 --iterations=20 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql
Tell the program to load the create, insert, and query SQL statements from the specified files, where the 告诉程序从指定文件加载创建、插入和查询SQL语句,其中create.sql
file has multiple table creation statements delimited by ';'
and multiple insert statements delimited by ';'
. create.sql
文件有多个用';'
分隔的表创建语句和多个以';'
分隔的插入语句。The --query
file should contain multiple queries delimited by ';'
. --query
文件应包含多个由';'
分隔的查询。Run all the load statements, then run all the queries in the query file with five clients (five times each):运行所有加载语句,然后使用五个客户端运行查询文件中的所有查询(每个客户端运行五次):
mysqlslap --concurrency=5 --iterations=5 --query=query.sql --create=create.sql --delimiter=";"
mysqlslap supports the following options, which can be specified on the command line or in the mysqlslap支持以下选项,可以在命令行或选项文件的[mysqlslap]
and [client]
groups of an option file. [mysqlslap]
和[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.18 mysqlslap Options选项
--auto-generate-sql | |||
---|---|---|---|
--auto-generate-sql-add-autoincrement | |||
--auto-generate-sql-execute-number | |||
--auto-generate-sql-guid-primary | |||
--auto-generate-sql-load-type | |||
--auto-generate-sql-secondary-indexes | |||
--auto-generate-sql-unique-query-number | |||
--auto-generate-sql-unique-write-number | --auto-generate-sql-write-number 要生成多少个不同的查询 | ||
--auto-generate-sql-write-number | |||
--commit | |||
--compress | 8.0.18 | ||
--compression-algorithms | 8.0.18 | ||
--concurrency | SELECT 语句时要模拟的客户端数量 | ||
--create | |||
--create-schema | |||
--csv | |||
--debug | |||
--debug-check | |||
--debug-info | |||
--default-auth | |||
--defaults-extra-file | |||
--defaults-file | |||
--defaults-group-suffix | |||
--delimiter | |||
--detach | |||
--enable-cleartext-plugin | |||
--engine | |||
--get-server-public-key | |||
--help | |||
--host | |||
--iterations | |||
--login-path | .mylogin.cnf 读取登录路径选项 | ||
--no-defaults | |||
--no-drop | |||
--number-char-cols | --auto-generate-sql ,则要使用的VARCHAR 列数 | ||
--number-int-cols | --auto-generate-sql ,则要使用的INT 列数 | ||
--number-of-queries | |||
--only-print | |||
--password | |||
--pipe | |||
--plugin-dir | |||
--port | |||
--post-query | |||
--post-system | system() 执行的字符串 | ||
--pre-query | |||
--pre-system | system() 执行的字符串 | ||
--print-defaults | |||
--protocol | |||
--query | SELECT 语句的文件或字符串 | ||
--server-public-key-path | |||
--shared-memory-base-name | |||
--silent | |||
--socket | |||
--sql-mode | |||
--ssl-ca | |||
--ssl-capath | |||
--ssl-cert | |||
--ssl-cipher | |||
--ssl-crl | |||
--ssl-crlpath | |||
--ssl-fips-mode | |||
--ssl-key | |||
--ssl-mode | |||
--tls-ciphersuites | 8.0.16 | ||
--tls-version | |||
--user | |||
--verbose | |||
--version | |||
--zstd-compression-level | 8.0.18 |
--help
, -?
Display a help message and exit.显示帮助消息并退出。
Generate SQL statements automatically when they are not supplied in files or using command options.当SQL语句未在文件中提供或使用命令选项时,会自动生成SQL语句。
--auto-generate-sql-add-autoincrement
Add an 将AUTO_INCREMENT
column to automatically generated tables.AUTO_INCREMENT
列添加到自动生成的表中。
--auto-generate-sql-execute-number=
N
Specify how many queries to generate automatically.指定要自动生成的查询数量。
--auto-generate-sql-guid-primary
Add a GUID-based primary key to automatically generated tables.将基于GUID的主键添加到自动生成的表中。
--auto-generate-sql-load-type=
type
Specify the test load type. 指定测试负载类型。The permissible values are 允许的值有read
(scan tables), write
(insert into tables), key
(read primary keys), update
(update primary keys), or mixed
(half inserts, half scanning selects). The default is mixed
.read
(扫描表)、write
(插入表)、key
(读取主键)、update
(更新主键)或mixed
(半插入,半扫描选择)。默认设置是混合的。
--auto-generate-sql-secondary-indexes=
N
Specify how many secondary indexes to add to automatically generated tables. By default, none are added.指定要添加到自动生成的表中的辅助索引的数量。默认情况下,不添加任何内容。
--auto-generate-sql-unique-query-number=
N
How many different queries to generate for automatic tests. For example, if you run a 为自动测试生成多少个不同的查询。例如,如果您运行一个执行1000次选择的key
test that performs 1000 selects, you can use this option with a value of 1000 to run 1000 unique queries, or with a value of 50 to perform 50 different selects. The default is 10.key
测试,则可以使用值为1000的此选项运行1000个唯一查询,或使用值为50的此选项执行50个不同的选择。默认值为10。
--auto-generate-sql-unique-write-number=
N
How many different queries to generate for 要生成多少个不同的查询--auto-generate-sql-write-number
. The default is 10.--auto-generate-sql-write-number
。默认值为10。
--auto-generate-sql-write-number=
N
How many row inserts to perform. The default is 100.要执行多少行插入。默认值为100。
How many statements to execute before committing. The default is 0 (no commits are done).在提交之前要执行多少语句。默认值为0(不进行提交)。
--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 to be removed in a future version of MySQL. See Configuring Legacy Connection Compression.从MySQL 8.0.18开始,此选项已被弃用。预计它将在MySQL的未来版本中被删除。请参阅配置传统连接压缩。
--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中添加的。
--concurrency=
, N
-c
N
The number of parallel clients to simulate.要模拟的并行客户端的数量。
The file or string containing the statement to use for creating the table.包含用于创建表的语句的文件或字符串。
The schema in which to run the tests.运行测试的模式。
If the 如果同时给出了--auto-generate-sql
option is also given, mysqlslap drops the schema at the end of the test run. To avoid this, use the --no-drop
option as well.--auto-generate-sql
选项,mysqlslap会在测试运行结束时删除模式。为了避免这种情况,也可以使用--no-drop
选项。
Generate output in comma-separated values format. The output goes to the named file, or to the standard output if no file is given.以逗号分隔值格式生成输出。输出将转到指定的文件,如果没有给出文件,则转到标准输出。
--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/mysqlslap.trace
.debug_options
字符串是d:t:o,file_name
。默认值是d:t:o,/tmp/mysqlslap.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
. MySQL release binaries provided by Oracle are not built using this option.WITH_DEBUG
构建时,此选项才可用。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节,“可插拔身份验证”。
--defaults-extra-file=
file_name
Read this option file after the global option file but (on Unix) before the user option file. If the file does not exist or is otherwise inaccessible, an error occurs. 在全局选项文件之后读取此选项文件,但(在Unix上)在用户选项文件之前读取。如果文件不存在或无法访问,则会发生错误。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, mysqlslap normally reads the 例如,mysqlslap通常读取[client]
and [mysqlslap]
groups. [client]
和[mysqlslap]
组。If this option is given as 如果将此选项设置为--defaults-group-suffix=_other
, mysqlslap also reads the [client_other]
and [mysqlslap_other]
groups.--defaults-group-suffix=_other
,mysqlslap也会读取[client_other]
和[mysqlslap_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节,“影响选项文件处理的命令行选项”。
--delimiter=
, str
-F
str
The delimiter to use in SQL statements supplied in files or using command options.在文件中提供的SQL语句或使用命令选项时使用的分隔符。
Detach (close and reopen) each connection after each 在每个N
statements. The default is 0 (connections are not detached).N
个语句之后分离(关闭并重新打开)每个连接。默认值为0(连接未分离)。
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节,“客户端明文可插拔身份验证”。)
--engine=
, engine_name
-e
engine_name
The storage engine to use for creating tables.用于创建表的存储引擎。
Request from the server the RSA public key that it uses for key pair-based password exchange. This option applies to clients that connect to the server using an account that authenticates with the 从服务器请求用于基于密钥对的密码交换的RSA公钥。此选项适用于使用caching_sha2_password
authentication plugin. caching_sha2_password
身份验证插件进行身份验证的帐户连接到服务器的客户端。For connections by such accounts, the server does not send the public key to the client unless requested. The option is ignored for accounts that do not authenticate with that plugin. 对于此类帐户的连接,除非有请求,否则服务器不会将公钥发送给客户端。对于不使用该插件进行身份验证的帐户,该选项将被忽略。It is also ignored if RSA-based password exchange is not needed, 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可插拔身份验证”。
--host=
, host_name
-h
host_name
Connect to the MySQL server on the given host.连接到给定主机上的MySQL服务器。
--iterations=
, N
-i
N
The number of times to run the tests.运行测试的次数。
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_editor--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节,“影响选项文件处理的命令行选项”。
Prevent mysqlslap from dropping any schema it creates during the test run.防止mysqlslap删除它在测试运行期间创建的任何模式。
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节,“影响选项文件处理的命令行选项”。
--number-char-cols=
, N
-x
N
The number of 如果指定了VARCHAR
columns to use if --auto-generate-sql
is specified.--auto-generate-sql
,要使用的VARCHAR
列数。
--number-int-cols=
, N
-y
N
The number of 如果指定了INT
columns to use if --auto-generate-sql
is specified.--auto-generate-sql
要使用的INT
列数。
Limit each client to approximately this many queries. Query counting takes into account the statement delimiter. 将每个客户端限制在大约这个数量的查询。查询计数考虑了语句分隔符。For example, if you invoke mysqlslap as follows, the 例如,如果你按如下方式调用mysqlslap,识别分隔符;
delimiter is recognized so that each instance of the query string counts as two queries. As a result, 5 rows (not 10) are inserted.;
,以便查询字符串的每个实例都算作两个查询。结果,插入了5行(不是10行)。
mysqlslap --delimiter=";" --number-of-queries=10 --query="use test;insert into t values(null)"
Do not connect to databases. mysqlslap only prints what it would have done.不要连接到数据库。mysqlslap只打印它会做的事情。
--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, mysqlslap prompts for one. 如果没有给出,mysqlslap会提示输入一个。If given, there must be no space between 如果给定,则--password=
or -p
and the password following it. If no password option is specified, the default is to send no password.--password=
或-p
与其后面的密码之间不得有空格。如果未指定密码选项,则默认情况下不发送密码。
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 mysqlslap should not prompt for one, use the 要明确指定没有密码并且mysqlslap不应提示输入密码,请使用--skip-password
option.--skip-password
选项。
--pipe
, -W
On Windows, connect to the server using a named pipe. 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组的成员。
The directory in which to look for plugins. 查找插件的目录。Specify this option if the 如果使用--default-auth
option is used to specify an authentication plugin but mysqlslap does not find it. --default-auth
选项指定身份验证插件,但mysqlslap找不到它,请指定此选项。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连接,要使用的端口号。
The file or string containing the statement to execute after the tests have completed. This execution is not counted for timing purposes.包含测试完成后要执行的语句的文件或字符串。出于计时目的,此执行不计算在内。
The string to execute using 测试完成后使用system()
after the tests have completed. This execution is not counted for timing purposes.system()
执行的字符串。出于计时目的,此执行不计算在内。
The file or string containing the statement to execute before running the tests. This execution is not counted for timing purposes.包含在运行测试之前要执行的语句的文件或字符串。出于计时目的,此执行不计算在内。
The string to execute using 在运行测试之前使用system()
before running the tests. This execution is not counted for timing purposes.system()
执行的字符串。出于计时目的,此执行不计算在内。
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节,“影响选项文件处理的命令行选项”。
--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节,“连接传输协议”。
--query=
, value
-q
value
The file or string containing the 包含用于检索数据的SELECT
statement to use for retrieving data.SELECT
语句的文件或字符串。
--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
系统变量以支持共享内存连接的情况。
--silent
, -s
Silent mode. No output.静音模式。无输出。
--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组的成员。
Set the SQL mode for the client session.设置客户端会话的SQL模式。
Options that begin with 以--ssl
specify whether to connect to the server using encryption and indicate where to find SSL keys and certificates. --ssl
开头的选项指定是否使用加密连接到服务器,并指示在哪里查找ssl密钥和证书。See Command Options for Encrypted Connections.请参见加密连接的命令选项。
--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模式下运行。
--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协议和密码”。
--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. Print more information about what the program does. This option can be used multiple times to increase the amount of information.详细模式。打印有关程序功能的更多信息。此选项可以多次使用以增加信息量。
--version
, -V
Display version information and exit.显示版本信息并退出。
--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中添加的。