When you start the mysqld server, you can specify program options using any of the methods described in Section 4.2.2, “Specifying Program Options”. 启动mysqld服务器时,可以使用第4.2.2节,“指定程序选项”中描述的任何方法指定程序选项。The most common methods are to provide options in an option file or on the command line. 最常用的方法是在选项文件或命令行中提供选项。However, in most cases it is desirable to make sure that the server uses the same options each time it runs. 但是,在大多数情况下,最好确保服务器在每次运行时使用相同的选项。The best way to ensure this is to list them in an option file. 确保这一点的最佳方法是在选项文件中列出它们。See Section 4.2.2.2, “Using Option Files”. 请参阅第4.2.2.2节,“使用选项文件”。That section also describes option file format and syntax.该部分还介绍了选项文件格式和语法。
mysqld reads options from the mysqld从[mysqld]
and [server]
groups. [mysqld]
和[server]
组读取选项。mysqld_safe reads options from the mysqld_safe从[mysqld]
, [server]
, [mysqld_safe]
, and [safe_mysqld]
groups. [mysqld]
、[server]
、[mysqld_safe]
和[safe_mysqld]
组读取选项。mysql.server reads options from the mysql.server从[mysqld]
and [mysql.server]
groups.[mysqld]
和[mysql.server]
组读取选项。
mysqld accepts many command options. mysqld接受许多命令选项。For a brief summary, execute this command:要获得简要摘要,请执行以下命令:
mysqld --help
To see the full list, use this command:若要查看完整列表,请使用以下命令:
mysqld --verbose --help
Some of the items in the list are actually system variables that can be set at server startup. 列表中的某些项实际上是可以在服务器启动时设置的系统变量。These can be displayed at runtime using the 可以使用SHOW VARIABLES
statement. SHOW VARIABLES
语句在运行时显示这些变量。Some items displayed by the preceding mysqld command do not appear in 前面的SHOW VARIABLES
output; this is because they are options only and not system variables.mysqld
命令显示的某些项目不会出现在SHOW VARIABLES
输出中;这是因为它们只是选项,而不是系统变量。
The following list shows some of the most common server options. 下面的列表显示了一些最常见的服务器选项。Additional options are described in other sections:其他部分介绍了其他选项:
Options that affect security: See Section 6.1.4, “Security-Related mysqld Options and Variables”.影响安全性的选项:请参阅第6.1.4节,“与安全相关的mysqld选项和变量”。
SSL-related options: See Command Options for Encrypted Connections.SSL相关选项:请参阅加密连接的命令选项。
Binary log control options: See Section 5.4.4, “The Binary Log”.二进制日志控制选项:请参阅第5.4.4节,“二进制日志”。
Replication-related options: See Section 17.1.6, “Replication and Binary Logging Options and Variables”.复制相关选项:请参阅第17.1.6节,“复制和二进制日志记录选项和变量”。
Options for loading plugins such as pluggable storage engines: See Section 5.6.1, “Installing and Uninstalling Plugins”.加载插件(如可插入存储引擎)的选项:请参阅第5.6.1节,“安装和卸载插件”。
Options specific to particular storage engines: See Section 15.14, “InnoDB Startup Options and System Variables” and Section 16.2.1, “MyISAM Startup Options”.特定存储引擎的选项:请参阅第15.14节,“InnoDB
启动选项和系统变量”和第16.2.1节,“MyISAM
启动选项”。
Some options control the size of buffers or caches. 有些选项控制缓冲区或缓存的大小。For a given buffer, the server might need to allocate internal data structures. 对于给定的缓冲区,服务器可能需要分配内部数据结构。These structures typically are allocated from the total memory allocated to the buffer, and the amount of space required might be platform dependent. 这些结构通常从分配给缓冲区的总内存中分配,所需的空间量可能取决于平台。This means that when you assign a value to an option that controls a buffer size, the amount of space actually available might differ from the value assigned. 这意味着,当为控制缓冲区大小的选项指定值时,实际可用的空间量可能与指定的值不同。In some cases, the amount might be less than the value assigned. 在某些情况下,数量可能小于指定的值。It is also possible that the server adjusts a value upward. 服务器也可能向上调整值。For example, if you assign a value of 0 to an option for which the minimal value is 1024, the server sets the value to 1024.例如,如果将值0指定给最小值为1024的选项,则服务器会将该值设置为1024。
Values for buffer sizes, lengths, and stack sizes are given in bytes unless otherwise specified.除非另有规定,缓冲区大小、长度和堆栈大小的值均以字节为单位。
Some options take file name values. Unless otherwise specified, the default file location is the data directory if the value is a relative path name. 有些选项采用文件名值。除非另有规定,否则如果值是相对路径名,则默认文件位置为数据目录。To specify the location explicitly, use an absolute path name. 要显式指定位置,请使用绝对路径名。Suppose that the data directory is 假设数据目录为/var/mysql/data
. /var/mysql/data
。If a file-valued option is given as a relative path name, it is located under 如果文件值选项作为相对路径名给出,则它位于/var/mysql/data
. /var/mysql/data
下。If the value is an absolute path name, its location is as given by the path name.如果该值是绝对路径名,则其位置由路径名给定。
You can also set the values of server system variables at server startup by using variable names as options. 还可以在服务器启动时使用变量名作为选项来设置服务器系统变量的值。To assign a value to a server system variable, use an option of the form 要为服务器系统变量赋值,请使用形式为--
. var_name
=value
--var_name=value
的选项。For example, 例如,--sort_buffer_size=384M
sets the sort_buffer_size
variable to a value of 384MB.--sort_buffer_size=384M
将sort_buffer_size
变量的值设置为384MB。
When you assign a value to a variable, MySQL might automatically correct the value to stay within a given range, or adjust the value to the closest permissible value if only certain values are permitted.当您为变量赋值时,MySQL可能会自动更正该值,使其保持在给定的范围内,或者在只允许某些值的情况下将该值调整为最接近的允许值。
To restrict the maximum value to which a system variable can be set at runtime with the 要限制在运行时使用SET
statement, specify this maximum by using an option of the form --maximum-
at server startup.var_name
=value
SET
语句设置系统变量的最大值,请在服务器启动时,使用以下形式的选项指定此最大值--max-var_name=value
。
You can change the values of most system variables at runtime with the 您可以使用SET
statement. SET
语句在运行时更改大多数系统变量的值。See Section 13.7.6.1, “SET Syntax for Variable Assignment”.请参阅第13.7.6.1节,“变量赋值的设置语法”。
Section 5.1.8, “Server System Variables”, provides a full description for all variables, and additional information for setting them at server startup and runtime. 第5.1.8节,“服务器系统变量”提供了所有变量的完整说明,以及在服务器启动和运行时设置这些变量的附加信息。For information on changing system variables, see Section 5.1.1, “Configuring the Server”.有关更改系统变量的信息,请参阅第5.1.1节,“配置服务器”。
--help
, -?
--help |
Display a short help message and exit. 显示简短的帮助信息并退出。Use both the 请使用--verbose
and --help
options to see the full message.--verbose
和--help
选项查看完整消息。
--admin-ssl[={OFF|ON}] | |
8.0.21 | |
8.0.26 | |
Boolean | |
ON |
The --admin-ssl
option is like the --ssl
option, except that it applies to the administrative connection interface rather than the main connection interface. --admin-ssl
选项与--ssl
选项类似,只是它适用于管理连接接口而不是主连接接口。For information about these interfaces, see Section 5.1.12.1, “Connection Interfaces”.有关这些接口的信息,请参阅第5.1.12.1节,“连接接口”。
The --admin-ssl
option specifies that the server permits but does not require encrypted connections on the administrative interface. This option is enabled by default.--admin-ssl
选项指定服务器允许但不需要管理接口上的加密连接。此选项在默认情况下处于启用状态。
--admin-ssl
can be specified in negated form as --skip-admin-ssl
or a synonym (--admin-ssl=OFF
, --disable-admin-ssl
). --admin-ssl
可以以否定形式指定为--skip-admin-ssl
或同义词(--admin-ssl=OFF
、--disable-admin-ssl
)。In this case, the option specifies that the server does not permit encrypted connections, regardless of the settings of the 在这种情况下,该选项指定服务器不允许加密连接,无论admin_tsl_
and xxx
admin_ssl_
system variables.xxx
admin_tsl_xxx
和admin_ssl_xxx
系统变量的设置如何。
The --admin-ssl
option has an effect only at server startup on whether the administrative interface supports encrypted connections. --admin-ssl
选项仅在服务器启动时对管理接口是否支持加密连接有影响。It is ignored and has no effect on the operation of 它被忽略,并且在运行时对ALTER INSTANCE RELOAD TLS
at runtime. ALTER INSTANCE RELOAD TLS
的操作没有影响。For example, you can use 例如,您可以使用--admin-ssl=OFF
to start the administrative interface with encrypted connections disabled, then reconfigure TLS and execute ALTER INSTANCE RELOAD TLS FOR CHANNEL mysql_admin
to enable encrypted connections at runtime.--admin-ssl=OFF
在禁用加密连接的情况下启动管理接口,然后重新配置TLS并执行ALTER INSTANCE RELOAD TLS FOR CHANNEL mysql_admin
以在运行时启用加密连接。
For general information about configuring connection-encryption support, see Section 6.3.1, “Configuring MySQL to Use Encrypted Connections”. 有关配置连接加密支持的一般信息,请参阅第6.3.1节,“配置MySQL以使用加密连接”。That discussion is written for the main connection interface, but the parameter names are similar for the administrative connection interface. 该讨论是针对主连接接口编写的,但参数名称与管理连接接口类似。Consider setting at least the 请考虑在服务器端至少设置admin_ssl_cert
and admin_ssl_key
system variables on the server side and the --ssl-ca
(or --ssl-capath
) option on the client side. admin_ssl_cert
和admin_ssl_key
系统变量,在客户端至少设置--ssl-ca
(或--ssl-capath
)选项。For additional information specifically about the administrative interface, see Administrative Interface Support for Encrypted Connections.有关管理接口的其他信息,请参阅加密连接的管理接口支持。
Because support for encrypted connections is enabled by default, it is normally unnecessary to specify 因为默认情况下启用了对加密连接的支持,所以通常不需要指定--admin-ssl
. --admin-ssl
。As of MySQL 8.0.26, 从MySQL 8.0.26开始,--admin-ssl
is deprecated and subject to removal in a future MySQL version. --admin-ssl
已被弃用,并将在未来的MySQL版本中删除。If it is desired to disable encrypted connections, that can be done without specifying 如果希望禁用加密连接,则无需以否定形式指定--admin-ssl
in negated form. Set the admin_tls_version
system variable to the empty value to indicate that no TLS versions are supported. -admin-ssl
即可完成。将admin_tls_version
系统变量设置为空值,表示不支持tls版本。For example, these lines in the server 例如,服务器my.cnf
file disable encrypted connections:my.cnf
文件中的这些行禁用加密连接:
[mysqld] admin_tls_version=''
--allow-suspicious-udfs[={OFF|ON}] | |
Boolean | |
OFF |
This option controls whether loadable functions that have only an 此选项控制是否可以加载主函数只有xxx
symbol for the main function can be loaded. xxx
符号的可加载函数。By default, the option is off and only loadable functions that have at least one auxiliary symbol can be loaded; this prevents attempts at loading functions from shared object files other than those containing legitimate functions. 默认情况下,该选项处于关闭状态,并且只能加载至少具有一个辅助符号的可加载函数;这可以防止尝试从共享对象文件加载函数,而不是从包含合法函数的文件加载函数。See Loadable Function Security Precautions.请参阅可加载功能安全注意事项。
--ansi |
Use standard (ANSI) SQL syntax instead of MySQL syntax. 使用标准(ANSI)SQL语法而不是MySQL语法。For more precise control over the server SQL mode, use the 要更精确地控一致性务器SQL模式,请改用--sql-mode
option instead. --sql-mode
选项。See Section 1.7, “MySQL Standards Compliance”, and Section 5.1.11, “Server SQL Modes”.请参阅第1.7节,“MySQL标准符合性”和第5.1.11节,“服务器SQL模式”。
--basedir=
, dir_name
-b
dir_name
--basedir=dir_name | |
basedir | |
Global | |
No | |
SET_VAR Hint Applies | No |
The path to the MySQL installation directory. MySQL安装目录的路径。This option sets the 此选项设置basedir
system variable.basedir
系统变量。
The server executable determines its own full path name at startup and uses the parent of the directory in which it is located as the default 服务器可执行文件在启动时确定自己的完整路径名,并使用其所在目录的父目录作为默认的basedir
value. basedir
值。This in turn enables the server to use that 这反过来又使服务器能够在搜索与服务器相关的信息(如包含错误消息的basedir
when searching for server-related information such as the share
directory containing error messages.share
目录)时使用该basedir
。
--character-set-client-handshake
--character-set-client-handshake[={OFF|ON}] | |
Boolean | |
ON |
Do not ignore character set information sent by the client. 不要忽略客户端发送的字符集信息。To ignore client information and use the default server character set, use 要忽略客户端信息并使用默认的服务器字符集,请使用--skip-character-set-client-handshake
; this makes MySQL behave like MySQL 4.0.--skip-character-set-client-handshake
;这使得MySQL的行为类似于MySQL 4.0。
--chroot=
, dir_name
-r
dir_name
--chroot=dir_name | |
Put the mysqld server in a closed environment during startup by using the 在启动过程中,使用chroot()
system call. chroot()
系统调用将mysqld服务器置于一个封闭的环境中。This is a recommended security measure. Use of this option somewhat limits 这是建议的安全措施。此选项的使用在一定程度上限制了LOAD DATA
and SELECT ... INTO OUTFILE
.LOAD DATA
和SELECT ... INTO OUTFILE
。
--console | |
Windows |
(Windows only.) (仅限Windows。)Cause the default error log destination to be the console. 使默认错误日志目标为控制台。This affects log sinks that base their own output destination on the default destination. 这会影响将其自己的输出目标基于默认目标的日志接收器。See Section 5.4.2, “The Error Log”. 请参阅第5.4.2节,“错误日志”。mysqld does not close the console window if this option is used.如果使用此选项,mysqld不会关闭控制台窗口。
如果两者都给定,--console
takes precedence over --log-error
if both are given.--console
优先于--log-error
。
--core-file[={OFF|ON}] | |
Boolean | |
OFF |
Write a core file if mysqld dies. 如果mysqld死了,写一个核心文件。The name and location of the core file is system dependent. 核心文件的名称和位置取决于系统。On Linux, a core file named 在Linux上,一个名为core.
is written to the current working directory of the process, which for mysqld is the data directory. pid
pid
represents the process ID of the server process. core.pid
的核心文件被写入进程的当前工作目录,对于mysqld来说,该目录是数据目录。pid表示服务器进程的进程ID。On macOS, a core file named 在macOS上,一个名为core.
is written to the pid
/cores
directory. core.pid
的核心文件被写入/cores目录。On Solaris, use the coreadm command to specify where to write the core file and how to name it.在Solaris上,使用coreadm命令指定核心文件的写入位置和命名方式。
For some systems, to get a core file you must also specify the 对于某些系统,要获得核心文件,还必须为mysqld_safe指定--core-file-size
option to mysqld_safe. --core-file-size
选项。See Section 4.3.2, “mysqld_safe — MySQL Server Startup Script”. 请参阅第4.3.2节,“mysqld_safe:MySQL Server启动脚本”。On some systems, such as Solaris, you do not get a core file if you are also using the 在某些系统(如Solaris)上,如果同时使用--user
option. --user
选项,则不会获得核心文件。There might be additional restrictions or limitations. For example, it might be necessary to execute ulimit -c unlimited before starting the server. Consult your system documentation.可能存在其他限制或限制。例如,在启动服务器之前,可能需要执行ulimit -c unlimited。请参阅您的系统文档。
The innodb_buffer_pool_in_core_file
variable can be used to reduce the size of core files on operating systems that support it. innodb_buffer_pool_in_core_file
变量可用于减小支持它的操作系统上的核心文件的大小。For more information, see Section 15.8.3.7, “Excluding Buffer Pool Pages from Core Files”.有关更多信息,请参阅第15.8.3.7节,“从核心文件中排除缓冲池页面”。
--daemonize
, -D
--daemonize[={OFF|ON}] | |
Boolean | |
OFF |
This option causes the server to run as a traditional, forking daemon, permitting it to work with operating systems that use systemd for process control. 此选项使服务器作为传统的分叉守护进程运行,允许它与使用systemd进行进程控制的操作系一致性起工作。For more information, see Section 2.5.9, “Managing MySQL Server with systemd”.有关更多信息,请参阅第2.5.9节,“使用systemd管理MySQL服务器”。
--daemonize
is mutually exclusive with --initialize
and --initialize-insecure
.--daemonize
与--initialize
和--initialize-insecure
互斥。
If the server is started using the 如果服务器是使用--daemonize
option and is not connected to a tty device, a default error logging option of --log-error=""
is used in the absence of an explicit logging option, to direct error output to the default log file.--daemonize
选项启动的,并且未连接到tty设备,则在没有显式日志记录选项的情况下,将使用--log-error=""
的默认错误日志记录选项,将错误输出引导到默认日志文件。
-D
is a synonym for --daemonize
.-D
是--daemonize
的同义词。
--datadir=
, dir_name
-h
dir_name
--datadir=dir_name | |
datadir | |
Global | |
No | |
SET_VAR Hint Applies | No |
The path to the MySQL server data directory. MySQL服务器数据目录的路径。This option sets the 此选项设置datadir
system variable. datadir
系统变量。See the description of that variable.请参见该变量的说明。
--debug[=
, debug_options
]-# [
debug_options
]
--debug[=debug_options] | |
debug | |
Global, Session | |
Yes | |
SET_VAR Hint Applies | No |
String | |
d:t:i:o,/tmp/mysqld.trace | |
d:t:i:O,\mysqld.trace |
If MySQL is configured with the 如果MySQL配置有-DWITH_DEBUG=1
CMake option, you can use this option to get a trace file of what mysqld is doing. -DWITH_DEBUG=1
CMake选项,则可以使用此选项获取mysqld正在执行的操作的跟踪文件。A typical 一个典型的debug_options
string is d:t:o,
. file_name
debug_options
字符串是d:t:o,file_name
。The default is 在Unix上默认为d:t:i:o,/tmp/mysqld.trace
on Unix and d:t:i:O,\mysqld.trace
on Windows.d:t:i:o,/tmp/mysqld.trace
,在Windows上默认为d:t:i:O,\mysqld.trace
。
Using 使用-DWITH_DEBUG=1
to configure MySQL with debugging support enables you to use the --debug="d,parser_debug"
option when you start the server. -DWITH_DEBUG=1
配置支持调试的MySQL,可以在启动服务器时使用--debug="d,parser_debug"
选项。This causes the Bison parser that is used to process SQL statements to dump a parser trace to the server's standard error output. Typically, this output is written to the error log.这导致用于处理SQL语句的Bison解析器将解析器跟踪转储到服务器的标准错误输出。通常,此输出会写入错误日志。
This option may be given multiple times. Values that begin with 此选项可以多次给定。以+
or -
are added to or subtracted from the previous value. +
或-
开头的值将与上一个值相加或相减。For example, 例如,--debug=T
--debug=+P
sets the value to P:T
.--debug=T
--debug=+P
将值设置为P:T
。
For more information, see Section 5.9.4, “The DBUG Package”.有关更多信息,请参阅第5.9.4节,“DBUG包”。
--debug-sync-timeout[=#] | |
Integer |
Controls whether the Debug Sync facility for testing and debugging is enabled. 控制是否启用用于测试和调试的调试同步功能。Use of Debug Sync requires that MySQL be configured with the 使用调试同步需要使用-DENABLE_DEBUG_SYNC=1
CMake option (see Section 2.9.7, “MySQL Source-Configuration Options”). -DENABLE_DEBUG_SYNC=1
CMake选项配置MySQL(请参阅第2.9.7节,“MySQL源配置选项”)。If Debug Sync is not compiled in, this option is not available. The option value is a timeout in seconds. 如果未在中编译调试同步,则此选项不可用。选项值是以秒为单位的超时。The default value is 0, which disables Debug Sync. To enable it, specify a value greater than 0; this value also becomes the default timeout for individual synchronization points. If the option is given without a value, the timeout is set to 300 seconds.默认值为0,这将禁用调试同步。若要启用它,请指定一个大于0的值;该值也成为各个同步点的默认超时值。如果给定的选项没有值,则超时设置为300秒。
For a description of the Debug Sync facility and how to use synchronization points, see MySQL Internals: Test Synchronization.有关调试同步功能以及如何使用同步点的描述,请参阅MySQL内部:测试同步。
--default-time-zone=name | |
String |
Set the default server time zone. This option sets the global 设置默认服务器时区。此选项设置全局time_zone
system variable. time_zone
系统变量。If this option is not given, the default time zone is the same as the system time zone (given by the value of the 如果未给定此选项,则默认时区与系统时区相同(由system_time_zone
system variable.system_time_zone
系统变量的值给定)。
--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
不是绝对路径名,则会相对于当前目录进行解释。This must be the first option on the command line if it is used.如果使用此选项,则它必须是命令行上的第一个选项。
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 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
, mysqld reads mysqld-auto.cnf
.--defaults-file
,mysqld也会读取mysqld-auto.cnf
。
This must be the first option on the command line if it is used, except that if the server is started with the 如果使用此选项,则它必须是命令行上的第一个选项,但如果服务器是使用--defaults-file
and --install
(or --install-manual
) options, --install
(or --install-manual
) must be first.--defaults-file
和--install
(或--install-manual
)选项启动的,则必须首先使用--install
。
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, mysqld normally reads the 例如,mysqld通常读取[mysqld]
group. [mysqld]
组。If this option is given as 如果这个选项被指定为--defaults-group-suffix=_other
, mysqld also reads the [mysqld_other]
group.--defaults-group-suffix=_other
,那么mysqld也会读取[mysqld_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节,“影响选项文件处理的命令行选项”。
--early-plugin-load=
plugin_list
--early-plugin-load=plugin_list | |
String | |
empty string |
This option tells the server which plugins to load before loading mandatory built-in plugins and before storage engine initialization. 此选项告诉服务器在加载强制内置插件和存储引擎初始化之前要加载哪些插件。If multiple 如果给定了多个--early-plugin-load
options are given, only the last one applies.--early-plugin-load
选项,则仅应用最后一个选项。
The option value is a semicolon-separated list of 选项值是一个以分号分隔的plugin_library
and name
=
plugin_library
values. plugin_library
和name=plugin_library
值列表。Each 每个plugin_library
is the name of a library file that contains plugin code, and each name
is the name of a plugin to load. plugin_library
都是包含插件代码的库文件的名称,每个name
都是要加载的插件的名称。If a plugin library is named without any preceding plugin name, the server loads all plugins in the library. 如果一个插件库的命名没有任何前面的插件名称,则服务器会加载库中的所有插件。With a preceding plugin name, the server loads only the named plugin from the libary. 对于前面的插件名称,服务器仅从库中加载命名的插件。The server looks for plugin library files in the directory named by the 服务器在由plugin_dir
system variable.plugin_dir
系统变量命名的目录中查找插件库文件。
For example, if plugins named 例如,如果名为myplug1
and myplug2
are contained in the plugin library files myplug1.so
and myplug2.so
, use this option to perform an early plugin load:myplug1
和myplug2
的插件包含在插件库文件myplug1.so
和myplug2.so
中,请使用此选项执行早期插件加载:
mysqld --early-plugin-load="myplug1=myplug1.so;myplug2=myplug2.so"
Quotes surround the argument value because otherwise some command interpreters interpret semicolon (引号环绕参数值,因为在其他情况下,某些命令解释器会将分号(;
) as a special character. (For example, Unix shells treat it as a command terminator.);
)解释为特殊字符。(例如,Unix shell将其视为命令终止符。)
Each named plugin is loaded early for a single invocation of mysqld only. 每个命名插件都会提前加载,仅用于mysqld的单个调用。After a restart, the plugin is not loaded early unless 重新启动后,除非再次使用--early-plugin-load
is used again.--early-plugin-load
,否则不会提前加载插件。
If the server is started using 如果服务器是使用--initialize
or --initialize-insecure
, plugins specified by --early-plugin-load
are not loaded.--initialize
或--initialize-insecure
启动的,则不会加载由--early-plugin-load
指定的插件。
If the server is run with 如果使用--help
, plugins specified by --early-plugin-load
are loaded but not initialized. --help
运行服务器,则会加载--early-plugin-load
指定的插件,但不会进行初始化。This behavior ensures that plugin options are displayed in the help message.此行为可确保插件选项显示在帮助消息中。
InnoDB
tablespace encryption relies on the MySQL Keyring for encryption key management, and the keyring plugin to be used must be loaded prior to storage engine initialization to facilitate InnoDB
recovery for encrypted tables. InnoDB
表空间加密依赖MySQL Keyring进行加密密钥管理,并且必须在存储引擎初始化之前加载要使用的Keyring插件,以便于InnoDB
恢复加密表。For example, administrators who want the 例如,希望在启动时加载keyring_file
plugin loaded at startup should use --early-plugin-load
with the appropriate option value (such as keyring_file.so
on Unix and Unix-like systems or keyring_file.dll
on Windows).keyring_file
插件的管理员应该使用带有适当选项值的--early-plugin-load
(例如Unix和类Unix系统上的keyring_file.so
或Windows上的keyring_file.dll
)。
For information about 有关InnoDB
tablespace encryption, see Section 15.13, “InnoDB Data-at-Rest Encryption”. InnoDB
表空间加密的信息,请参阅第15.13节,“休息时的InnoDB数据加密”。For general information about plugin loading, see Section 5.6.1, “Installing and Uninstalling Plugins”.有关插件加载的一般信息,请参阅第5.5.1节,“安装和卸载插件”。
For MySQL Keyring, this option is used only when the keystore is managed with a keyring plugin. 对于MySQL Keyring,此选项仅在使用Keyring插件管理密钥库时使用。If keystore management uses a keyring component rather than a plugin, specify component loading using a manifest file; see Section 6.4.4.2, “Keyring Component Installation”.如果密钥库管理使用密钥环组件而不是插件,请使用清单文件指定组件加载;参见第6.4.4.2节,“钥匙圈组件安装”。
--exit-info[=
, flags
]-T [
flags
]
--exit-info[=flags] | |
Integer |
This is a bitmask of different flags that you can use for debugging the mysqld server. Do not use this option unless you know exactly what it does!这是一个不同标志的位掩码,可以用于调试mysqld服务器。除非你确切地知道它的作用,否则不要使用此选项!
--external-locking[={OFF|ON}] | |
Boolean | |
OFF |
Enable external locking (system locking), which is disabled by default. 启用外部锁定(系统锁定),这在默认情况下是禁用的。If you use this option on a system on which 如果在lockd
does not fully work (such as Linux), it is easy for mysqld to deadlock.lockd
不能完全工作的系统(如Linux)上使用此选项,mysqld很容易死锁。
To disable external locking explicitly, use 要显式禁用外部锁定,请使用--skip-external-locking
.--skip-external-locking
。
External locking affects only 外部锁定仅影响MyISAM
table access. MyISAM
表访问。For more information, including conditions under which it can and cannot be used, see Section 8.11.5, “External Locking”.有关更多信息,包括可使用和不可使用的条件,请参阅第8.11.5节,“外部锁定”。
--flush[={OFF|ON}] | |
flush | |
Global | |
Yes | |
SET_VAR Hint Applies | No |
Boolean | |
OFF |
Flush (synchronize) all changes to disk after each SQL statement. Normally, MySQL does a write of all changes to disk only after each SQL statement and lets the operating system handle the synchronizing to disk. 在每条SQL语句之后,将所有更改刷新(同步)到磁盘。通常,MySQL只在每条SQL语句之后将所有更改写入磁盘,并让操作系统处理与磁盘的同步。See Section B.3.3.3, “What to Do If MySQL Keeps Crashing”.请参阅B.3.3.3节,“如果MySQL持续崩溃该怎么办”。
If 如果指定了--flush
is specified, the value of flush_time
does not matter and changes to flush_time
have no effect on flush behavior.--flush
,flush_time
的值无关紧要,对flush_time
的更改对flush行为没有影响。
--gdb[={OFF|ON}] | |
Boolean | |
OFF |
Install an interrupt handler for 为SIGINT
(needed to stop mysqld with ^C
to set breakpoints) and disable stack tracing and core file handling. SIGINT
安装一个中断处理程序(需要使用^C
停止mysqld以设置断点),并禁用堆栈跟踪和核心文件处理。See Section 5.9.1.4, “Debugging mysqld under gdb”.请参阅第5.9.1.4节,“在gdb下调试mysqld”。
On Windows, this option also suppresses the forking that is used to implement the 在Windows上,此选项还抑制用于实现RESTART
statement: Forking enables one process to act as a monitor to the other, which acts as the server. RESTART
语句的分叉:分叉使一个进程能够充当另一个进程的监视器,后者充当服务器。However, forking makes determining the server process to attach to for debugging more difficult, so starting the server with 但是,分叉会使确定要连接到的服务器进程以进行调试变得更加困难,因此使用--gdb
suppresses forking. --gdb
启动服务器会抑制分叉。For a server started with this option, 对于使用此选项启动的服务器,RESTART
simply exits and does not restart.RESTART
只是退出而不重新启动。
In non-debug settings, 在非调试设置中,--no-monitor
may be used to suppress forking the monitor process.--no-monitor
可以用于抑制对监视器进程的分叉。
--initialize
, -I
--initialize[={OFF|ON}] | |
Boolean | |
OFF |
This option is used to initialize a MySQL installation by creating the data directory and populating the tables in the 此选项用于通过创建数据目录并填充mysql
system schema. For more information, see Section 2.10.1, “Initializing the Data Directory”.mysql
系统模式中的表来初始化MySQL安装。有关更多信息,请参阅第2.10.1节,“初始化数据目录”。
When the server is started with 当服务器使用--initialize
, some functionality is unavailable that limits the statements permitted in any file named by the init_file
system variable. --initialize
启动时,某些功能不可用,这限制了init_file
系统变量命名的任何文件中允许的语句。For more information, see the description of that variable. 有关详细信息,请参阅该变量的描述。In addition, the 此外,disabled_storage_engines
system variable has no effect.disabled_storage_engines
系统变量没有任何作用。
The 与--ndbcluster
option is ignored when used together with --initialize
.--initialize
一起使用时,将忽略--ndbcluster
选项。
--initialize
is mutually exclusive with --daemonize
.--initialize
与--daemolize
互斥。
-I
is a synonym for --initialize
.-I
是--initialize
的同义词。
--initialize-insecure[={OFF|ON}] | |
Boolean | |
OFF |
This option is used to initialize a MySQL installation by creating the data directory and populating the tables in the 此选项用于通过创建数据目录并填充mysql
system schema. This option implies --initialize
. mysql
系统模式中的表来初始化MySQL安装。此选项意味着--initialize
。For more information, see the description of that option, and Section 2.10.1, “Initializing the Data Directory”.有关更多信息,请参阅该选项的说明以及第2.10.1节,“初始化数据目录”。
--initialize-insecure
is mutually exclusive with --daemonize
.--initialize-insecure
与--daemonize
互斥。
--innodb-
xxx
Set an option for the 为InnoDB
storage engine. The InnoDB
options are listed in Section 15.14, “InnoDB Startup Options and System Variables”.InnoDB
存储引擎设置一个选项。InnoDB
选项列在第15.14节,“InnoDB启动选项和系统变量”中。
--install [service_name] | |
Windows |
(Windows only) Install the server as a Windows service that starts automatically during Windows startup. (仅限Windows)将服务器作为Windows服务安装,该服务在Windows启动期间自动启动。The default service name is 如果未给定MySQL
if no service_name
value is given. service_name
值,则默认服务名称为MySQL
。For more information, see Section 2.3.4.8, “Starting MySQL as a Windows Service”.有关更多信息,请参阅第2.3.4.8节,“将MySQL作为Windows服务启动”。
If the server is started with the 如果服务器是使用--defaults-file
and --install
options, --install
must be first.--defaults-file
和--install
选项启动的,则必须首先使用--install
。
--install-manual [
service_name
]
--install-manual [service_name] | |
Windows |
(Windows only) Install the server as a Windows service that must be started manually. It does not start automatically during Windows startup. (仅限Windows)将服务器安装为必须手动启动的Windows服务。它不会在Windows启动期间自动启动。The default service name is 如果未给定MySQL
if no service_name
value is given. For more information, see Section 2.3.4.8, “Starting MySQL as a Windows Service”.service_name
值,则默认服务名称为MySQL
。有关更多信息,请参阅第2.3.4.8节,“将MySQL作为Windows服务启动”。
If the server is started with the 如果服务器是使用--defaults-file
and --install-manual
options, --install-manual
must be first.--defaults-file
和--install-manual
选项启动的,则必须首先使用--install-manual
。
--language=
lang_name
, -L lang_name
--language=name | |
Yes; use lc-messages-dir instead | |
language | |
Global | |
No | |
SET_VAR Hint Applies | No |
/usr/local/mysql/share/mysql/english/ |
The language to use for error messages. 用于错误消息的语言。lang_name
can be given as the language name or as the full path name to the directory where the language files are installed. lang_name
可以作为语言名称,也可以作为安装语言文件的目录的完整路径名。See Section 10.12, “Setting the Error Message Language”.请参阅第10.12节,“设置错误消息语言”。
应该使用--lc-messages-dir
and --lc-messages
should be used rather than --language
, which is deprecated (and handled as a synonym for --lc-messages-dir
). --lc-messages-dir
和--lc-messages
,而不是--language
,后者已被弃用(并作为--lc-mmessages-dir
的同义词处理)。You should expect the 您应该预期在未来的MySQL版本中删除--language
option to be removed in a future MySQL release.--language
选项。
--large-pages[={OFF|ON}] | |
large_pages | |
Global | |
No | |
SET_VAR Hint Applies | No |
Linux | |
Boolean | |
OFF |
Some hardware/operating system architectures support memory pages greater than the default (usually 4KB). The actual implementation of this support depends on the underlying hardware and operating system. 一些硬件/操作系统架构支持大于默认值(通常为4KB)的内存页。这种支持的实际实现取决于底层硬件和操作系统。Applications that perform a lot of memory accesses may obtain performance improvements by using large pages due to reduced Translation Lookaside Buffer (TLB) misses.由于减少了翻译后备缓冲区(TLB)未命中,执行大量内存访问的应用程序可以通过使用大页面来获得性能改进。
MySQL supports the Linux implementation of large page support (which is called HugeTLB in Linux). MySQL支持Linux实现的大页面支持(在Linux中称为HugeTLB)。See Section 8.12.3.2, “Enabling Large Page Support”. 请参阅第8.12.3.2节,“启用大页面支持”。For Solaris support of large pages, see the description of the 有关Solaris对大页面的支持,请参阅--super-large-pages
option.--super-large-pages
选项的说明。
--large-pages
is disabled by default.默认情况下被禁用。
--lc-messages=name | |
lc_messages | |
Global, Session | |
Yes | |
SET_VAR Hint Applies | No |
String | |
en_US |
The locale to use for error messages. The default is 用于错误消息的区域设置。默认值为en_US
. en_US
。The server converts the argument to a language name and combines it with the value of 服务器将参数转换为语言名称,并将其与--lc-messages-dir
to produce the location for the error message file. --lc-messages-dir
的值组合,以生成错误消息文件的位置。See Section 10.12, “Setting the Error Message Language”.请参阅第10.12节,“设置错误消息语言”。
--lc-messages-dir=dir_name | |
lc_messages_dir | |
Global | |
No | |
SET_VAR Hint Applies | No |
The directory where error messages are located. 错误消息所在的目录。The server uses the value together with the value of 服务器将该值与--lc-messages
to produce the location for the error message file. --lc-messages
的值一起用于生成错误消息文件的位置。See Section 10.12, “Setting the Error Message Language”.请参阅第10.12节,“设置错误消息语言”。
--local-service |
(Windows only) A (仅限Windows)服务名称后面--local-service
option following the service name causes the server to run using the LocalService
Windows account that has limited system privileges. --local-service
选项会导致服务器使用具有有限系统权限的LocalService
Windows帐户运行。If both 如果在服务名称后面同时提供--defaults-file
and --local-service
are given following the service name, they can be in any order. --defaults-file
和--local-service
,它们可以按任何顺序排列。See Section 2.3.4.8, “Starting MySQL as a Windows Service”.请参阅第2.3.4.8节,“将MySQL作为Windows服务启动”。
--log-error[=file_name] | |
log_error | |
Global | |
No | |
SET_VAR Hint Applies | No |
Set the default error log destination to the named file. This affects log sinks that base their own output destination on the default destination. 将默认错误日志目标设置为命名文件。这会影响将自己的输出目标基于默认目标的日志接收器。See Section 5.4.2, “The Error Log”.请参阅第5.4.2节,“错误日志”。
If the option names no file, the default error log destination on Unix and Unix-like systems is a file named 如果该选项没有命名任何文件,则Unix和类Unix系统上的默认错误日志目标是数据目录中名为
in the data directory. host_name
.errhost_name.err
的文件。The default destination on Windows is the same, unless the 除非指定了--pid-file
option is specified. --pid-file
选项,否则Windows上的默认目标是相同的。In that case, the file name is the PID file base name with a suffix of 在这种情况下,文件名是数据目录中后缀为.err
in the data directory..err
的PID文件基名称。
If the option names a file, the default destination is that file (with an 如果该选项为文件命名,则默认目标是位于数据目录下的文件(如果名称没有后缀,则添加.err
suffix added if the name has no suffix), located under the data directory unless an absolute path name is given to specify a different location..err
后缀),除非指定了绝对路径名以指定其他位置。
If error log output cannot be redirected to the error log file, an error occurs and startup fails.如果错误日志输出无法重定向到错误日志文件,则会发生错误,启动失败。
On Windows, 在Windows上,如果同时给定--console
takes precedence over --log-error
if both are given. --console
和--log-error
,则前者优先于后者。In this case, the default error log destination is the console rather than a file.在这种情况下,默认的错误日志目标是控制台,而不是文件。
--log-isam[=file_name] | |
File name |
Log all 将所有MyISAM
changes to this file (used only when debugging MyISAM
).MyISAM
更改记录到此文件(仅在调试MyISAM
时使用)。
--log-raw[={OFF|ON}] | |
log_raw | |
Global | |
Yes | |
SET_VAR Hint Applies (≥ 8.0.19) | No |
Boolean | |
OFF |
Passwords in certain statements written to the general query log, slow query log, and binary log are rewritten by the server not to occur literally in plain text. 写入通用查询日志、慢速查询日志和二进制日志的某些语句中的密码由服务器重写,使其不会以纯文本形式出现。Password rewriting can be suppressed for the general query log by starting the server with the 通过使用--log-raw
option. --log-raw
选项启动服务器,可以抑制常规查询日志的密码重写。This option may be useful for diagnostic purposes, to see the exact text of statements as received by the server, but for security reasons is not recommended for production use.此选项可能有助于诊断,以查看服务器接收到的语句的确切文本,但出于安全原因,不建议在生产中使用。
If a query rewrite plugin is installed, the 如果安装了查询重写插件,--log-raw
option affects statement logging as follows:--log-raw
选项会影响语句日志记录,如下所示:
For more information, see Section 6.1.2.3, “Passwords and Logging”.有关更多信息,请参阅第6.1.2.3节,“密码和日志记录”。
--log-short-format[={OFF|ON}] | |
Boolean | |
OFF |
Log less information to the slow query log, if it has been activated.将较少的信息记录到慢速查询日志中(如果已激活)。
--log-tc=file_name | |
File name | |
tc.log |
The name of the memory-mapped transaction coordinator log file (for XA transactions that affect multiple storage engines when the binary log is disabled). 内存映射事务协调器日志文件的名称(对于在禁用二进制日志时影响多个存储引擎的XA事务)。The default name is 默认名称为tc.log
. The file is created under the data directory if not given as a full path name. This option is unused.tc.log
。如果没有提供完整的路径名,则会在数据目录下创建该文件。此选项未使用。
--log-tc-size=# | |
Integer | |
6 * page size | |
6 * page size | |
18446744073709551615 | |
4294967295 |
The size in bytes of the memory-mapped transaction coordinator log. The default and minimum values are 6 times the page size, and the value must be a multiple of the page size.内存映射的事务协调器日志的大小(以字节为单位)。默认值和最小值为页面大小的6倍,并且该值必须是页面大小的倍数。
--memlock[={OFF|ON}] | |
Boolean | |
OFF |
Lock the mysqld process in memory. 将mysqld进程锁定在内存中。This option might help if you have a problem where the operating system is causing mysqld to swap to disk.如果您遇到操作系统导致mysqld交换到磁盘的问题,此选项可能会有所帮助。
--memlock
works on systems that support the mlockall()
system call; this includes Solaris, most Linux distributions that use a 2.4 or higher kernel, and perhaps other Unix systems. --memlock
适用于支持mlockall()
系统调用的系统;这包括Solaris、大多数使用2.4或更高内核的Linux发行版,也许还有其他Unix系统。On Linux systems, you can tell whether or not 在Linux系统上,您可以通过检查mlockall()
(and thus this option) is supported by checking to see whether or not it is defined in the system mman.h
file, like this:mlockall()
(以及此选项)是否在系统mman.h
文件中定义来判断它是否受支持,如下所示:
shell> grep mlockall /usr/include/sys/mman.h
If 如果支持mlockall()
is supported, you should see in the output of the previous command something like the following:mlockall()
,您应该在上一个命令的输出中看到如下内容:
extern int mlockall (int __flags) __THROW;
Use of this option may require you to run the server as 使用此选项可能需要以root
, which, for reasons of security, is normally not a good idea. See Section 6.1.5, “How to Run MySQL as a Normal User”.root
身份运行服务器,出于安全考虑,这通常不是一个好主意。请参阅第6.1.5节,“如何以普通用户身份运行MySQL”。
On Linux and perhaps other systems, you can avoid the need to run the server as 在Linux和其他系统上,可以通过更改root
by changing the limits.conf
file. limits.conf
文件来避免以root
身份运行服务器。See the notes regarding the memlock limit in Section 8.12.3.2, “Enabling Large Page Support”.请参阅第8.12.3.2节,“启用大页面支持”中关于内存锁定限制的注释。
You must not use this option on a system that does not support the 不能在不支持mlockall()
system call; if you do so, mysqld is very likely to exit as soon as you try to start it.mlockall()
系统调用的系统上使用此选项;如果这样做,mysqld很可能会在您尝试启动它时立即退出。
--myisam-block-size=# | |
Integer | |
1024 | |
1024 | |
16384 |
The block size to be used for 用于MyISAM
index pages.MyISAM
索引页的块大小。
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. This must be the first option on the command line if it is used.--no-defaults
可以阻止读取这些选项。如果使用此选项,则它必须是命令行上的第一个选项。
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节,“影响选项文件处理的命令行选项”。
--no-dd-upgrade[={OFF|ON}] | |
8.0.16 | |
Boolean | |
OFF |
This option is deprecated as of MySQL 8.0.16. It is superseded by the 从MySQL 8.0.16开始,此选项已被弃用。它被--upgrade
option, which provides finer control over data dictionary and server upgrade behavior.--upgrade
选项取代,后者提供了对数据字典和服务器升级行为的更精细控制。
Prevent automatic upgrade of the data dictionary tables during the MySQL server startup process. This option is typically used when starting the MySQL server following an in-place upgrade of an existing installation to a newer MySQL version, which may include changes to data dictionary table definitions.防止在MySQL服务器启动过程中自动升级数据字典表。此选项通常在将现有安装就地升级到较新的MySQL版本后启动MySQL服务器时使用,其中可能包括对数据字典表定义的更改。
When 当---no-dd-upgrade
is specified, and the server finds that its expected version of the data dictionary differs from the version stored in the data dictionary itself, startup fails with an error stating that data dictionary upgrade is prohibited;--no-dd-upgrade
被指定时,并且服务器发现其预期的数据字典版本与存储在数据字典中的版本不同时,启动失败,并显示一个错误,说明禁止数据字典升级;
[ERROR] [MY-011091] [Server] Data dictionary upgrade prohibited by the command line option '--no_dd_upgrade'. [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
During a normal startup, the data dictionary version of the server is compared to the version stored in the data dictionary to determine whether data dictionary table definitions should be upgraded. 在正常启动期间,将服务器的数据字典版本与存储在数据字典中的版本进行比较,以确定是否应该升级数据字典表定义。If an upgrade is necessary and supported, the server creates data dictionary tables with updated definitions, copies persisted metadata to the new tables, atomically replaces the old tables with the new ones, and reinitializes the data dictionary. 如果需要并支持升级,服务器将创建具有更新定义的数据字典表,将持久化元数据复制到新表,用新表原子替换旧表,并重新初始化数据字典。If an upgrade is not necessary, startup continues without updating data dictionary tables.如果不需要升级,则在不更新数据字典表的情况下继续启动。
--no-monitor[={OFF|ON}] | |
8.0.12 | |
Windows | |
Boolean | |
OFF |
(Windows only). This option suppresses the forking that is used to implement the (仅限Windows)。此选项抑制用于实现RESTART
statement: Forking enables one process to act as a monitor to the other, which acts as the server. RESTART
语句的分叉:分叉使一个进程能够充当另一个进程的监视器,后者充当服务器。For a server started with this option, 对于使用此选项启动的服务器,RESTART
simply exits and does not restart.RESTART
只是退出而不重新启动。
--no-monitor
is not available prior to MySQL 8.0.12. The --gdb
option can be used as a workaround.--no-monitor
对MySQL 8.0.12之前的版本不可用。--gdb
选项可以作为一种变通方法。
--old-style-user-limits[={OFF|ON}] | |
Boolean | |
OFF |
Enable old-style user limits. (Before MySQL 5.0.3, account resource limits were counted separately for each host from which a user connected rather than per account row in the 启用旧式用户限制。(在MySQL 5.0.3之前,帐户资源限制是为用户连接的每个主机单独计算的,而不是为user
table.) user
表中的每个帐户行计算的。)See Section 6.2.20, “Setting Account Resource Limits”.请参阅第6.2.20节,“设置帐户资源限制”。
--performance-schema-xxx
Configure a Performance Schema option. For details, see Section 27.14, “Performance Schema Command Options”.配置性能架构选项。有关详细信息,请参阅第27.14节,“性能模式命令选项”。
--plugin-load=plugin_list | |
plugin_load | |
Global | |
No | |
SET_VAR Hint Applies | No |
String |
This option tells the server to load the named plugins at startup. 此选项告诉服务器在启动时加载命名插件。If multiple 如果给定了多个--plugin-load
options are given, only the last one applies. --plugin-load
选项,则仅应用最后一个选项。Additional plugins to load may be specified using 可以使用--plugin-load-add
options.--plugin-load-add
选项指定要加载的其他插件。
The option value is a semicolon-separated list of 选项值是一个以分号分隔的plugin_library
and name
=
plugin_library
values. plugin_library
和name=plugin_library
值列表。Each 每个plugin_library
is the name of a library file that contains plugin code, and each name
is the name of a plugin to load. plugin_library
都是包含插件代码的库文件的名称,每个name
都是要加载的插件的名称。If a plugin library is named without any preceding plugin name, the server loads all plugins in the library. With a preceding plugin name, the server loads only the named plugin from the libary. 如果一个插件库的命名没有任何前面的插件名称,则服务器会加载库中的所有插件。对于前面的插件名称,服务器仅从库中加载命名的插件。The server looks for plugin library files in the directory named by the 服务器在由plugin_dir
system variable.plugin_dir
系统变量命名的目录中查找插件库文件。
For example, if plugins named 例如,如果名为myplug1
and myplug2
are contained in the plugin library files myplug1.so
and myplug2.so
, use this option to perform an early plugin load:myplug1
和myplug2
的插件包含在插件库文件myplug1.so
和myplug2.so
中,请使用此选项执行早期插件加载:
mysqld --plugin-load="myplug1=myplug1.so;myplug2=myplug2.so"
Quotes surround the argument value because otherwise some command interpreters interpret semicolon (引号环绕参数值,因为在其他情况下,某些命令解释器会将分号(;
) as a special character. (For example, Unix shells treat it as a command terminator.);
)解释为特殊字符。(例如,Unix shell将其视为命令终止符。)
Each named plugin is loaded for a single invocation of mysqld only. 每个命名的插件只为一次调用mysqld而加载。After a restart, the plugin is not loaded unless 重新启动后,除非再次使用--plugin-load
is used again. --plugin-load
,否则不会加载插件。This is in contrast to 这与INSTALL PLUGIN
, which adds an entry to the mysql.plugins
table to cause the plugin to be loaded for every normal server startup.INSTALL PLUGIN
形成了对比,INSTALL PLUGIN
向mysql.plugins
表中添加了一个条目,以便在每次正常的服务器启动时加载插件。
During the normal startup sequence, the server determines which plugins to load by reading the 在正常启动过程中,服务器通过读取mysql.plugins
system table. mysql.plugins
系统表来确定要加载哪些插件。If the server is started with the 如果服务器是用--skip-grant-tables
option, plugins registered in the mysql.plugins
table are not loaded and are unavailable. --skip-grant-tables
选项启动的,那么在mysql.plugins
表中注册的插件将不会被加载并且不可用。--plugin-load
enables plugins to be loaded even when --skip-grant-tables
is given. --plugin-load
允许加载插件,即使给出了--skip-grant-tables
。--plugin-load
also enables plugins to be loaded at startup that cannot be loaded at runtime.--plugin-load
还允许在启动时加载无法在运行时加载的插件。
For additional information about plugin loading, see Section 5.6.1, “Installing and Uninstalling Plugins”.有关插件加载的更多信息,请参阅第5.5.1节,“安装和卸载插件”。
--plugin-load-add=plugin_list | |
plugin_load_add | |
Global | |
No | |
SET_VAR Hint Applies | No |
String |
This option complements the 此选项补充了--plugin-load
option. --plugin-load
选项。--plugin-load-add
adds a plugin or plugins to the set of plugins to be loaded at startup. --plugin-load-add
将一个或多个插件添加到启动时要加载的一组插件中。The argument format is the same as for 参数格式与--plugin-load
. --plugin-load
的参数格式相同。--plugin-load-add
can be used to avoid specifying a large set of plugins as a single long unwieldy --plugin-load
argument.--plugin-load-add
可以用来避免将一大组插件指定为一个长而笨拙的--plugin-load
参数。
--plugin-load-add
can be given in the absence of --plugin-load
, but any instance of --plugin-load-add
that appears before --plugin-load
. --plugin-load-add
可以在没有--plugin-load
的情况下给出,但出现在--plugin-load-add
之前的--plugin-load-add
实例除外。has no effect because 没有效果,因为--plugin-load
resets the set of plugins to load. In other words, these options:--plugin-load
重置了要加载的插件集。换句话说,这些选项:
--plugin-load=x --plugin-load-add=y
are equivalent to this option:等效于此选项:
--plugin-load="x;y"
But these options:但这些选项:
--plugin-load-add=y --plugin-load=x
are equivalent to this option:等效于此选项:
--plugin-load=x
For additional information about plugin loading, see Section 5.6.1, “Installing and Uninstalling Plugins”.有关插件加载的更多信息,请参阅第5.5.1节,“安装和卸载插件”。
Specifies an option that pertains to a server plugin. 指定与服务器插件相关的选项。For example, many storage engines can be built as plugins, and for such engines, options for them can be specified with a 例如,许多存储引擎可以构建为插件,对于这样的引擎,可以使用--plugin
prefix. --plugin
前缀指定它们的选项。Thus, the 因此,--innodb-file-per-table
option for InnoDB
can be specified as --plugin-innodb-file-per-table
.InnoDB
的--innodb-file-per-table
选项可以指定为--plugin-innodb-file-per-table
。
For boolean options that can be enabled or disabled, the 对于可以启用或禁用的布尔选项,也支持--skip
prefix and other alternative formats are supported as well (see Section 4.2.2.4, “Program Option Modifiers”). --skip
前缀和其他可选格式(请参阅第4.2.2.4节,“程序选项修改器”)。For example, 例如,--skip-plugin-innodb-file-per-table
disables innodb-file-per-table
.--skip-plugin-innodb-file-per-table
禁用innodb-file-per-table
。
The rationale for the --plugin
prefix is that it enables plugin options to be specified unambiguously if there is a name conflict with a built-in server option. --plugin
前缀的基本原理是,如果与内置服务器选项存在名称冲突,它可以明确指定插件选项。For example, were a plugin writer to name a plugin “sql” and implement a “mode” option, the option name might be 例如,如果一个插件编写器将一个插件命名为“sql”并实现一个“mode”选项,那么该选项的名称可能是--sql-mode
, which would conflict with the built-in option of the same name. --sql-mode
,这将与同名的内置选项相冲突。In such cases, references to the conflicting name are resolved in favor of the built-in option. 在这种情况下,对冲突名称的引用会被解析为支持内置选项。To avoid the ambiguity, users can specify the plugin option as 为了避免歧义,用户可以将插件选项指定为--plugin-sql-mode
. Use of the --plugin
prefix for plugin options is recommended to avoid any question of ambiguity.--plugin-sql-mode
。建议在插件选项中使用--plugin
前缀,以避免任何歧义问题。
--port=
, port_num
-P
port_num
--port=port_num | |
port | |
Global | |
No | |
SET_VAR Hint Applies | No |
Integer | |
3306 | |
0 | |
65535 |
The port number to use when listening for TCP/IP connections. On Unix and Unix-like systems, the port number must be 1024 or higher unless the server is started by the 侦听TCP/IP连接时要使用的端口号。在Unix和类Unix系统上,端口号必须为1024或更高,除非服务器是由root
operating system user. Setting this option to 0 causes the default value to be used.root
操作系统用户启动的。将此选项设置为0将使用默认值。
--port-open-timeout=# | |
Integer | |
0 |
On some systems, when the server is stopped, the TCP/IP port might not become available immediately. If the server is restarted quickly afterward, its attempt to reopen the port can fail. 在某些系统上,当服务器停止时,TCP/IP端口可能不会立即变为可用。如果服务器随后快速重新启动,则其重新打开端口的尝试可能会失败。This option indicates how many seconds the server should wait for the TCP/IP port to become free if it cannot be opened. The default is not to wait.此选项指示如果无法打开TCP/IP端口,服务器应等待多长秒才能使其空闲。默认情况是不等待。
Print the program name and all options that it gets from option files. Password values are masked. 打印程序名称及其从选项文件中获得的所有选项。密码值被屏蔽。This must be the first option on the command line if it is used, except that it may be used immediately after 如果使用此选项,则它必须是命令行上的第一个选项,但它可以在--defaults-file
or --defaults-extra-file
.--defaults-file
或--defaults-extra-file
之后立即使用。
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节,“影响选项文件处理的命令行选项”。
--remove [service_name] | |
Windows |
(Windows only) Remove a MySQL Windows service. The default service name is (仅限Windows)删除MySQL Windows服务。如果未给定MySQL
if no service_name
value is given. service_name
值,则默认服务名称为MySQL
。For more information, see Section 2.3.4.8, “Starting MySQL as a Windows Service”.有关更多信息,请参阅第2.3.4.8节,“将MySQL作为Windows服务启动”。
--safe-user-create[={OFF|ON}] | |
Boolean | |
OFF |
If this option is enabled, a user cannot create new MySQL users by using the 如果启用此选项,则用户无法使用GRANT
statement unless the user has the INSERT
privilege for the mysql.user
system table or any column in the table. GRANT
语句创建新的MySQL用户,除非用户具有mysql.user
系统表或表中任何列的INSERT
权限。If you want a user to have the ability to create new users that have those privileges that the user has the right to grant, you should grant the user the following privilege:如果希望用户能够创建具有用户有权授予的权限的新用户,则应授予该用户以下权限:
GRANT INSERT(user) ON mysql.user TO 'user_name
'@'host_name
';
This ensures that the user cannot change any privilege columns directly, but has to use the 这确保了用户不能直接更改任何特权列,而是必须使用GRANT
statement to give privileges to other users.GRANT
语句将特权授予其他用户。
--skip-grant-tables[={OFF|ON}] | |
Boolean | |
OFF |
This option affects the server startup sequence:此选项会影响服务器启动顺序:
--skip-grant-tables
causes the server not to read the grant tables in the mysql
system schema, and thus to start without using the privilege system at all. --skip-grant-tables
会导致服务器不读取mysql
系统模式中的grant表,从而在根本不使用特权系统的情况下启动。This gives anyone with access to the server unrestricted access to all databases.这使任何有权访问服务器的人都可以不受限制地访问所有数据库。
Because starting the server with 因为使用--skip-grant-tables
disables authentication checks, the server also disables remote connections in that case by enabling skip_networking
.--skip-grant-tables
启动服务器会禁用身份验证检查,所以在这种情况下,服务器还会通过启用skip_networking
来禁用远程连接。
To cause a server started with 要使以--skip-grant-tables
to load the grant tables at runtime, perform a privilege-flushing operation, which can be done in these ways:--skip-grant-tables
启动的服务器在运行时加载授予表,请执行权限刷新操作,该操作可以通过以下方式完成:
Issue a MySQL 连接到服务器后,发出MySQL FLUSH PRIVILEGES
statement after connecting to the server.FLUSH PRIVILEGES
语句。
Execute a mysqladmin flush-privileges or mysqladmin reload command from the command line.从命令行执行mysqladmin flush-privileges或mysqladmin reload命令。
Privilege flushing might also occur implicitly as a result of other actions performed after startup, thus causing the server to start using the grant tables. For example, the server flushes the privileges if it performs an upgrade during the startup sequence.由于启动后执行的其他操作,权限刷新也可能隐式发生,从而导致服务器开始使用授予表。例如,如果服务器在启动序列中执行升级,则会刷新权限。
--skip-grant-tables
disables failed-login tracking and temporary account locking because those capabilities depend on the grant tables. --skip-grant-tables
将禁用失败登录跟踪和临时帐户锁定,因为这些功能取决于授权表。See Section 6.2.15, “Password Management”.请参阅第6.2.15节,“密码管理”。
--skip-grant-tables
causes the server not to load certain other objects registered in the data dictionary or the mysql
system schema:--skip-grant-tables
会导致服务器不加载在数据字典或mysql
系统模式中注册的某些其他对象:
Scheduled events installed using 使用CREATE EVENT
and registered in the events
data dictionary table.CREATE EVENT
安装并在events
数据字典表中注册的计划事件。
Plugins installed using 使用INSTALL PLUGIN
and registered in the mysql.plugin
system table.INSTALL PLUGIN
安装并在mysql.plugin
系统表中注册的插件。
To cause plugins to be loaded even when using 要使插件即使在使用--skip-grant-tables
, use the --plugin-load
or --plugin-load-add
option.--skip-grant-tables
时也能加载,请使用--plugin-load
或--plugin-load-add
选项。
Loadable functions installed using 使用CREATE FUNCTION
and registered in the mysql.func
system table.CREATE FUNCTION
安装并在mysql.func
系统表中注册的可加载函数。
--skip-grant-tables
does not suppress loading during startup of components.--skip-grant-tables
不会在组件启动期间抑制加载。
--skip-grant-tables
causes the disabled_storage_engines
system variable to have no effect.--skip-grant-tables
会导致disabled_storage_engines
系统变量无效。
--skip-host-cache |
Disable use of the internal host cache for faster name-to-IP resolution. With the cache disabled, the server performs a DNS lookup every time a client connects.禁用使用内部主机缓存以加快名称到IP的解析。在禁用缓存的情况下,服务器每次连接客户端时都会执行DNS查找。
Use of 使用--skip-host-cache
is similar to setting the host_cache_size
system variable to 0, but host_cache_size
is more flexible because it can also be used to resize, enable, or disable the host cache at runtime, not just at server startup.--skip-host-cache
类似于将host_cache_size
系统变量设置为0,但host_cache_size
更灵活,因为它还可以用于在运行时调整主机缓存的大小、启用或禁用主机缓存,而不仅仅是在服务器启动时。
Starting the server with 使用--skip-host-cache
does not prevent runtime changes to the value of host_cache_size
, but such changes have no effect and the cache is not re-enabled even if host_cache_size
is set larger than 0.--skip-host-cache
启动服务器不会阻止运行时更改host_cache_size
的值,但这些更改没有任何效果,并且即使host_cache_size
设置为大于0,也不会重新启用缓存。
For more information about how the host cache works, see Section 5.1.12.3, “DNS Lookups and the Host Cache”.有关主机缓存如何工作的更多信息,请参阅第5.1.12.3节,“DNS查找和主机缓存”。
Disable the 禁用InnoDB
storage engine. InnoDB
存储引擎。In this case, because the default storage engine is 在这种情况下,因为默认存储引擎是InnoDB
, the server does not start unless you also use --default-storage-engine
and --default-tmp-storage-engine
to set the default to some other engine for both permanent and TEMPORARY
tables.InnoDB
,所以服务器不会启动,除非您还使用--default-storage-engine
和--default-tmp-storage-engine
将永久表和临时表的默认值设置为其他引擎。
The InnoDB
storage engine cannot be disabled, and the --skip-innodb
option is deprecated and has no effect. InnoDB
存储引擎不能被禁用,--skip-innodb
选项已被弃用且无效。Its use results in a warning. Expect this option to be removed in a future MySQL release.它的使用会导致警告。预计此选项将在未来的MySQL版本中删除。
--skip-new |
This option disables (what used to be considered) new, possibly unsafe behaviors. 此选项禁用(过去被认为是)新的、可能不安全的行为。It results in these settings: 其结果是:delay_key_write=OFF
, concurrent_insert=NEVER
, automatic_sp_privileges=OFF
. delay_key_write=OFF
,concurrent_insert=NEVER
,automatic_sp_privileges=OFF
。It also causes 对于不支持OPTIMIZE TABLE
to be mapped to ALTER TABLE
for storage engines for which OPTIMIZE TABLE
is not supported.OPTIMIZE TABLE
的存储引擎,它还导致将OPTIMIZE TABLE
映射到ALTER TABLE
。
--skip-show-database | |
skip_show_database | |
Global | |
No | |
SET_VAR Hint Applies | No |
Boolean | |
OFF |
This option sets the 此选项设置skip_show_database
system variable that controls who is permitted to use the SHOW DATABASES
statement. skip_show_database
系统变量,该变量控制允许谁使用SHOW DATABASES
语句。See Section 5.1.8, “Server System Variables”.请参阅第5.1.8节,“服务器系统变量”。
--skip-stack-trace |
Do not write stack traces. This option is useful when you are running mysqld under a debugger. 不要写入堆栈跟踪。当您在调试器下运行mysqld时,此选项非常有用。On some systems, you also must use this option to get a core file. See Section 5.9, “Debugging MySQL”.在某些系统上,还必须使用此选项来获取核心文件。请参阅第5.9节,“调试MySQL”。
--slow-start-timeout=# | |
Integer | |
15000 |
This option controls the Windows service control manager's service start timeout. The value is the maximum number of milliseconds that the service control manager waits before trying to kill the windows service during startup. 此选项控制Windows服务控制管理器的服务启动超时。该值是服务控制管理器在启动期间尝试终止windows服务之前等待的最大毫秒数。The default value is 15000 (15 seconds). If the MySQL service takes too long to start, you may need to increase this value. A value of 0 means there is no timeout.默认值为15000(15秒)。如果MySQL服务启动时间过长,则可能需要增加此值。值为0表示没有超时。
--socket={file_name|pipe_name} | |
socket | |
Global | |
No | |
SET_VAR Hint Applies | No |
String | |
MySQL | |
/tmp/mysql.sock |
On Unix, this option specifies the Unix socket file to use when listening for local connections. 在Unix上,此选项指定在侦听本地连接时要使用的Unix套接字文件。The default value is 默认值为/tmp/mysql.sock
. /tmp/mysql.sock
。If this option is given, the server creates the file in the data directory unless an absolute path name is given to specify a different directory. 如果给定此选项,则服务器将在数据目录中创建文件,除非给定绝对路径名以指定其他目录。On Windows, the option specifies the pipe name to use when listening for local connections that use a named pipe. 在Windows上,该选项指定在侦听使用命名管道的本地连接时要使用的管道名称。The default value is 默认值为MySQL
(not case-sensitive).MySQL
(不区分大小写)。
--sql-mode=
value
[,value
[,value
...]]
--sql-mode=name | |
sql_mode | |
Global, Session | |
Yes | |
SET_VAR Hint Applies | Yes |
Set | |
ONLY_FULL_GROUP_BY STRICT_TRANS_TABLES NO_ZERO_IN_DATE NO_ZERO_DATE ERROR_FOR_DIVISION_BY_ZERO NO_ENGINE_SUBSTITUTION | |
|
Set the SQL mode. See Section 5.1.11, “Server SQL Modes”.设置SQL模式。请参阅第5.1.11节,“服务器SQL模式”。
MySQL installation programs may configure the SQL mode during the installation process.MySQL安装程序可能会在安装过程中配置SQL模式。
If the SQL mode differs from the default or from what you expect, check for a setting in an option file that the server reads at startup.如果SQL模式与默认模式或预期模式不同,请检查服务器在启动时读取的选项文件中的设置。
--ssl[={OFF|ON}] | |
8.0.26 | |
Disabled by | skip-ssl |
Boolean | |
ON |
The --ssl
option specifies that the server permits but does not require encrypted connections on the main connection interface. This option is enabled by default.--ssl
选项指定服务器允许但不要求在主连接接口上进行加密连接。此选项在默认情况下处于启用状态。
A similar option, 类似的选项--admin-ssl
, is like the --ssl
, except that it applies to the administrative connection interface rather than the main connection interface. --admin-ssl
与--ssl
类似,只是它适用于管理连接接口而不是主连接接口。For information about these interfaces, see Section 5.1.12.1, “Connection Interfaces”.有关这些接口的信息,请参阅第5.1.12.1节,“连接接口”。
--ssl
can be specified in negated form as --skip-ssl
or a synonym (--ssl=OFF
, --disable-ssl
). --ssl
可以以否定形式指定为--skip-ssl
或同义词(--ssl=OFF
,--disable-ssl
)。In this case, the option specifies that the server does not permit encrypted connections, regardless of the settings of the 在这种情况下,该选项指定服务器不允许加密连接,无论tls_
and xxx
ssl_
system variables.xxx
tls_xxx
和ssl_xxx
系统变量的设置如何。
The --ssl
option has an effect only at server startup on whether the server supports encrypted connections. --ssl
选项仅在服务器启动时对服务器是否支持加密连接有影响。It is ignored and has no effect on the operation of 它被忽略,并且在运行时对ALTER INSTANCE RELOAD TLS
at runtime. ALTER INSTANCE RELOAD TLS
的操作没有影响。For example, you can use 例如,您可以使用--ssl=OFF
to start the server with encrypted connections disabled, then reconfigure TLS and execute ALTER INSTANCE RELOAD TLS
to enable encrypted connections at runtime.--ssl=OFF
在禁用加密连接的情况下启动服务器,然后重新配置TLS并执行ALTER INSTANCE RELOAD TLS
以在运行时启用加密连接。
For more information about configuring whether the server permits clients to connect using SSL and indicating where to find SSL keys and certificates, see Section 6.3.1, “Configuring MySQL to Use Encrypted Connections”, which also describes server capabilities for certificate and key file autogeneration and autodiscovery. 有关配置服务器是否允许客户端使用SSL连接以及指示在何处查找SSL密钥和证书的更多信息,请参阅第6.3.1节,“配置MySQL以使用加密连接”,该节还介绍了服务器自动生成证书和密钥文件以及自动发现的功能。Consider setting at least the 考虑在服务器端至少设置ssl_cert
and ssl_key
system variables on the server side and the --ssl-ca
(or --ssl-capath
) option on the client side.ssl_cert
和ssl_key
系统变量,在客户端至少设置--ssl-ca
(或--ssl-capath
)选项。
Because support for encrypted connections is enabled by default, it is normally unnecessary to specify 因为默认情况下启用了对加密连接的支持,所以通常不需要指定--ssl
. --ssl
。As of MySQL 8.0.26, 从MySQL 8.0.26开始,--ssl
is deprecated and subject to removal in a future MySQL version. --ssl
已被弃用,并将在未来的MySQL版本中删除。If it is desired to disable encrypted connections, that can be done without specifying 如果需要禁用加密连接,可以在不指定--ssl
in negated form. --ssl
的情况下以否定形式执行。Set the 将tls_version
system variable to the empty value to indicate that no TLS versions are supported. tls_version
系统变量设置为空值,表示不支持tls版本。For example, these lines in the server 例如,服务器my.cnf
file disable encrypted connections:my.cnf
文件中的这些行禁用加密连接:
[mysqld] tls_version=''
--standalone | |
Windows |
Available on Windows only; instructs the MySQL server not to run as a service.仅在Windows上可用;指示MySQL服务器不要作为服务运行。
--super-large-pages[={OFF|ON}] | |
Solaris | |
Boolean | |
OFF |
Standard use of large pages in MySQL attempts to use the largest size supported, up to 4MB. Under Solaris, a “super large pages” feature enables uses of pages up to 256MB. MySQL中大页面的标准使用尝试使用支持的最大大小,最高4MB。在Solaris下,“超大页面”功能允许使用高达256MB的页面。This feature is available for recent SPARC platforms. 此功能适用于最新的SPARC平台。It can be enabled or disabled by using the 可以使用--super-large-pages
or --skip-super-large-pages
option.--super-large-pages
或--skip-super-large-pages
选项来启用或禁用它。
--symbolic-links
, --skip-symbolic-links
--symbolic-links[={OFF|ON}] | |
Yes | |
Boolean | |
OFF |
Enable or disable symbolic link support. On Unix, enabling symbolic links means that you can link a 启用或禁用符号链接支持。在Unix上,启用符号链接意味着您可以使用MyISAM
index file or data file to another directory with the INDEX DIRECTORY
or DATA DIRECTORY
option of the CREATE TABLE
statement. CREATE TABLE
语句的INDEX DIRECTORY
或DATA DIRECTORY
选项将MyISAM
索引文件或数据文件链接到另一个目录。If you delete or rename the table, the files that its symbolic links point to also are deleted or renamed. 如果删除或重命名表,则其符号链接所指向的文件也将被删除或重命名。See Section 8.12.2.2, “Using Symbolic Links for MyISAM Tables on Unix”.请参阅第8.12.2.2节,“在Unix上使用MyISAM表的符号链接”。
Symbolic link support, along with the 不赞成使用符号链接支持以及控制它的--symbolic-links
option that controls it, is deprecated; you should expect it to be removed in a future version of MySQL. --Symbolic links
选项;您应该预期它在MySQL的未来版本中被删除。In addition, the option is disabled by default. The related 此外,该选项在默认情况下处于禁用状态。相关的have_symlink
system variable also is deprecated; expect it be removed in a future version of MySQL.have_symlink
系统变量也被弃用;期望它在MySQL的未来版本中被删除。
This option has no meaning on Windows.此选项在Windows上没有任何意义。
--sysdate-is-now[={OFF|ON}] | |
Boolean | |
OFF |
默认情况下,SYSDATE()
by default returns the time at which it executes, not the time at which the statement in which it occurs begins executing. SYSDATE()
返回它执行的时间,而不是它出现的语句开始执行的时间。This differs from the behavior of 这与NOW()
. NOW()
的行为不同。This option causes 此选项使SYSDATE()
to be a synonym for NOW()
. SYSDATE()
成为NOW()
的同义词。For information about the implications for binary logging and replication, see the description for 有关二进制日志记录和复制的含义的信息,请参阅第12.7节,“日期和时间函数”中SYSDATE()
in Section 12.7, “Date and Time Functions” and for SET TIMESTAMP
in Section 5.1.8, “Server System Variables”.SYSDATE()
和第5.1.8节,“服务器系统变量”中SET TIMESTAMP
的描述。
--tc-heuristic-recover={COMMIT|ROLLBACK}
--tc-heuristic-recover=name | |
Enumeration | |
OFF | |
|
The decision to use in a manual heuristic recovery.在手动启发式恢复中使用的决定。
If a 如果指定了--tc-heuristic-recover
option is specified, the server exits regardless of whether manual heuristic recovery is successful.--tc-heuristic-recover
选项,则无论手动启发式恢复是否成功,服务器都会退出。
On systems with more than one storage engine capable of two-phase commit, the 在具有多个能够进行两阶段提交的存储引擎的系统上,ROLLBACK
option is not safe and causes recovery to halt with the following error:ROLLBACK
选项不安全,会导致恢复停止,并出现以下错误:
[ERROR] --tc-heuristic-recover rollback strategy is not safe on systems with more than one 2-phase-commit-capable storage engine. Aborting crash recovery.
--transaction-isolation=name | |
transaction_isolation | |
Global, Session | |
Yes | |
SET_VAR Hint Applies | No |
Enumeration | |
REPEATABLE-READ | |
|
Sets the default transaction isolation level. 设置默认事务隔离级别。The level
value can be READ-UNCOMMITTED
, READ-COMMITTED
, REPEATABLE-READ
, or SERIALIZABLE
. See Section 13.3.7, “SET TRANSACTION Statement”.level
值可以是READ-UNCOMMITED
、READ-COMMITTED
、REPEATABLE-READ
或SERIALIZABLE
。参见第13.3.7节,“SET TRANSACTION语句”。
The default transaction isolation level can also be set at runtime using the 默认事务隔离级别也可以在运行时使用SET TRANSACTION
statement or by setting the transaction_isolation
system variable.SET TRANSACTION
语句或通过设置transaction_instance
系统变量来设置。
--transaction-read-only[={OFF|ON}] | |
transaction_read_only | |
Global, Session | |
Yes | |
SET_VAR Hint Applies | No |
Boolean | |
OFF |
Sets the default transaction access mode. By default, read-only mode is disabled, so the mode is read/write.设置默认事务访问模式。默认情况下,只读模式被禁用,因此该模式为读/写模式。
To set the default transaction access mode at runtime, use the 要在运行时设置默认事务访问模式,请使用SET TRANSACTION
statement or set the transaction_read_only
system variable. SET TRANSACTION
语句或设置transaction_read_only
系统变量。See Section 13.3.7, “SET TRANSACTION Statement”.请参阅第13.3.7节,“SET TRANSACTION语句”。
--tmpdir=
, dir_name
-t
dir_name
--tmpdir=dir_name | |
tmpdir | |
Global | |
No | |
SET_VAR Hint Applies | No |
The path of the directory to use for creating temporary files. It might be useful if your default 用于创建临时文件的目录的路径。如果您的默认/tmp
directory resides on a partition that is too small to hold temporary tables. /tmp
目录所在的分区太小,无法容纳临时表,那么这可能会很有用。This option accepts several paths that are used in round-robin fashion. Paths should be separated by colon characters (此选项接受以循环方式使用的多个路径。路径应在Unix上用冒号字符(:
) on Unix and semicolon characters (;
) on Windows.:
)分隔,在Windows上用分号字符(;
)分隔。
--tmpdir
can be a non-permanent location, such as a directory on a memory-based file system or a directory that is cleared when the server host restarts. --tmpdir
可以是一个非永久位置,例如基于内存的文件系统上的目录,或者在服务器主机重新启动时清除的目录。If the MySQL server is acting as a replica, and you are using a non-permanent location for 如果MySQL服务器充当副本,并且您正在使用--tmpdir
, consider setting a different temporary directory for the replica using the slave_load_tmpdir
system variable. --tmpdir
的非永久位置,请考虑使用slave_load_tmpdir
系统变量为副本设置一个不同的临时目录。For a replica, the temporary files used to replicate 对于复制副本,用于复制LOAD DATA
statements are stored in this directory, so with a permanent location they can survive machine restarts, although replication can now continue after a restart if the temporary files have been removed.LOAD DATA
语句的临时文件存储在此目录中,因此有了一个永久位置,它们可以在机器重新启动后存活下来,尽管如果临时文件已被删除,则复制现在可以在重新启动后继续。
For more information about the storage location of temporary files, see Section B.3.3.5, “Where MySQL Stores Temporary Files”.有关临时文件存储位置的更多信息,请参阅B.3.3.5节,“MySQL存储临时文件的位置”。
--upgrade=value | |
8.0.16 | |
Enumeration | |
AUTO | |
|
This option controls whether and how the server performs an automatic upgrade at startup. Automatic upgrade involves two steps:此选项控一致性务器是否以及如何在启动时执行自动升级。自动升级包括两个步骤:
Step 1: Data dictionary upgrade.步骤1:数据字典升级。
This step upgrades:此步骤升级:
The data dictionary tables in the mysql
schema. If the actual data dictionary version is lower than the current expected version, the server upgrades the data dictionary. If it cannot, or is prevented from doing so, the server cannot run.mysql
模式中的数据字典表。如果实际的数据字典版本低于当前的预期版本,则服务器会升级数据字典。如果不能或被阻止这样做,服务器将无法运行。
The Performance Schema and 性能模式和INFORMATION_SCHEMA
.INFORMATION_SCHEMA
。
Step 2: Server upgrade.步骤2:服务器升级。
This step comprises all other upgrade tasks. If the existing installation data has a lower MySQL version than the server expects, it must be upgraded:此步骤包括所有其他升级任务。如果现有安装数据的MySQL版本低于服务器预期的版本,则必须升级:
The system tables in the mysql
schema (the remaining non-data dictionary tables).mysql
模式中的系统表(剩余的非数据字典表)。
The sys
schema.sys
架构。
User schemas.用户架构。
For details about upgrade steps 1 and 2, see Section 2.11.3, “What the MySQL Upgrade Process Upgrades”.有关升级步骤1和2的详细信息,请参阅第2.11.3节,“MySQL升级过程升级内容”。
These 允许这些--upgrade
option values are permitted:--upgrade
选项值:
AUTO
The server performs an automatic upgrade of anything it finds to be out of date (steps 1 and 2). 服务器会自动升级它发现的任何过期内容(步骤1和2)。This is the default action if 如果没有明确指定--upgrade
is not specified explicitly.--upgrade
,则这是默认操作。
NONE
The server performs no automatic upgrade steps during the startup process (skips steps 1 and 2). Because this option value prevents a data dictionary upgrade, the server exits with an error if the data dictionary is found to be out of date:服务器在启动过程中不执行自动升级步骤(跳过步骤1和2)。由于此选项值阻止数据字典升级,因此如果发现数据字典过期,服务器将退出并返回错误:
[ERROR] [MY-013381] [Server] Server shutting down because upgrade is required, yet prohibited by the command line option '--upgrade=NONE'. [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
MINIMAL
The server upgrades the data dictionary, the Performance Schema, and the 如有必要,服务器将升级数据字典、性能模式和INFORMATION_SCHEMA
, if necessary (step 1). Note that following an upgrade with this option, Group Replication cannot be started, because system tables on which the replication internals depend are not updated, and reduced functionality might also be apparent in other areas.INFORMATION_SCHEMA
(步骤1)。请注意,使用此选项进行升级后,无法启动组复制,因为复制内部所依赖的系统表不会更新,而且在其他方面功能可能也会明显减少。
FORCE
The server upgrades the data dictionary, the Performance Schema, and the 如有必要,服务器将升级数据字典、性能模式和INFORMATION_SCHEMA
, if necessary (step 1). In addition, the server forces an upgrade of everything else (step 2). Expect server startup to take longer with this option because the server checks all objects in all schemas.INFORMATION_SCHEMA
(步骤1)。此外,服务器强制升级所有其他内容(步骤2)。由于服务器会检查所有模式中的所有对象,因此使用此选项预计服务器启动需要更长的时间。
如果服务器认为不需要执行步骤2的操作,则FORCE
is useful to force step 2 actions to be performed if the server thinks they are not necessary. For example, you may believe that a system table is missing or has become damaged and want to force a repair.FORCE
可用于强制执行这些操作。例如,您可能认为系统表丢失或已损坏,并希望强制进行修复。
The following table summarizes the actions taken by the server for each option value.下表总结了服务器对每个选项值所采取的操作。
AUTO | If necessary | If necessary |
---|---|---|
NONE | No | No |
MINIMAL | If necessary | No |
FORCE | If necessary | Yes |
--user={
, user_name
|user_id
}-u {
user_name
|user_id
}
--user=name | |
String |
Run the mysqld server as the user having the name 以名称为user_name
or the numeric user ID user_id
. user_name
或数字用户ID为user_id
的用户身份运行mysqld服务器。(“User” in this context refers to a system login account, not a MySQL user listed in the grant tables.)(本文中的“用户”指的是系统登录帐户,而不是授权表中列出的MySQL用户。)
This option is mandatory when starting mysqld as 当以root
. root
身份启动mysqld时,此选项是必需的。The server changes its user ID during its startup sequence, causing it to run as that particular user rather than as 服务器在启动过程中更改其用户ID,从而使其以特定用户而非root
. See Section 6.1.1, “Security Guidelines”.root
用户的身份运行。参见第6.1.1节,“安全指南”。
To avoid a possible security hole where a user adds a 为了避免用户在--user=root
option to a my.cnf
file (thus causing the server to run as root
), mysqld uses only the first --user
option specified and produces a warning if there are multiple --user
options. my.cnf
文件中添加--user=root
选项(从而导致服务器以root
身份运行)时可能出现的安全漏洞,mysqld只使用指定的第一个--user
选项,如果有多个--user
选项,则会产生警告。Options in /etc/my.cnf
and $MYSQL_HOME/my.cnf
are processed before command-line options, so it is recommended that you put a --user
option in /etc/my.cnf
and specify a value other than root
. /etc/my.cnf
和$MYSQL_HOME/my.cnf
中的选项是在命令行选项之前处理的,因此建议您在/etc/my.cnf
中放置一个--user
选项,并指定root
以外的值。The option in /etc/my.cnf
is found before any other --user
options, which ensures that the server runs as a user other than root
, and that a warning results if any other --user
option is found./etc/my.cnf
中的选项位于任何其他--user
选项之前,这可以确保服务器以root
以外的用户身份运行,并且如果找到任何其他--user
选项,则会产生警告。
--validate-config[={OFF|ON}] | |
8.0.16 | |
Boolean | |
OFF |
Validate the server startup configuration. If no errors are found, the server terminates with an exit code of 0. If an error is found, the server displays a diagnostic message and terminates with an exit code of 1. 验证服务器启动配置。如果没有发现错误,服务器将终止,退出代码为0。如果发现错误,服务器将显示一条诊断消息,并以退出代码1终止。Warning and information messages may also be displayed, depending on the 根据log_error_verbosity
value, but do not produce immediate validation termination or an exit code of 1. log_error_verbosity
值,也可能显示警告和信息消息,但不会立即产生验证终止或退出代码1。For more information, see Section 5.1.3, “Server Configuration Validation”.有关更多信息,请参阅第5.1.3节,“服务器配置验证”。
--validate-user-plugins[={OFF|ON}]
--validate-user-plugins[={OFF|ON}] | |
Boolean | |
ON |
If this option is enabled (the default), the server checks each user account and produces a warning if conditions are found that would make the account unusable:如果启用了此选项(默认选项),则服务器会检查每个用户帐户,如果发现会导致帐户不可用的情况,则会发出警告:
The account requires an authentication plugin that is not loaded.该帐户需要一个未加载的身份验证插件。
The account requires the 该帐户需要sha256_password
or caching_sha2_password
authentication plugin but the server was started with neither SSL nor RSA enabled as required by the plugin.sha256_password
或caching_sha2_password
身份验证插件,但服务器启动时未按插件要求启用SSL或RSA。
Enabling 启用--validate-user-plugins
slows down server initialization and FLUSH PRIVILEGES
. --validate-user-plugins
会减慢服务器初始化和FLUSH PRIVILEGES
(刷新特权)的速度。If you do not require the additional checking, you can disable this option at startup to avoid the performance decrement.如果不需要额外的检查,可以在启动时禁用此选项以避免性能下降。
Use this option with the 将此选项与--help
option for detailed help.--help
选项一起使用可获得详细帮助。
--version
, -V
Display version information and exit.显示版本信息并退出。