START GROUP_REPLICATION [USER='user_name
'] [, PASSWORD='user_pass
'] [, DEFAULT_AUTH='plugin_name
']
Starts group replication. 启动组复制。This statement requires the 此语句需要GROUP_REPLICATION_ADMIN
privilege (or the deprecated SUPER
privilege). GROUP_REPLICATION_ADMIN
权限(或不推荐使用的SUPER
权限)。If 如果设置了super_read_only=ON
is set and the member should join as a primary, super_read_only
is set to OFF
once Group Replication successfully starts.super_read_only=ON
,并且成员应作为主成员加入,则一旦组复制成功启动,super_read_only
将设置为OFF
。
From MySQL 8.0.21, you can specify user credentials for distributed recovery on the 在MySQL 8.0.21中,您可以使用START GROUP_REPLICATION
statement using the USER
, PASSWORD
, and DEFAULT_AUTH
options, as follows:USER
、PASSWORD
和DEFAULT_AUTH
选项在START GROUP_REPLICATION
语句中指定分布式恢复的用户凭据,如下所示:
USER
: The replication user for distributed recovery. :用于分布式恢复的复制用户。For instructions to set up this account, see Section 18.2.1.3, “User Credentials For Distributed Recovery”. 有关设置此帐户的说明,请参阅第18.2.1.3节,“分布式恢复的用户凭据”。You cannot specify an empty or null string, or omit the 不能指定空字符串或空字符串,如果指定了USER
option if PASSWORD
is specified.PASSWORD
,也不能忽略USER
选项。
PASSWORD
: The password for the replication user account. :复制用户帐户的密码。The password cannot be encrypted, but it is masked in the query log.密码无法加密,但在查询日志中被屏蔽。
DEFAULT_AUTH
: The name of the authentication plugin used for the replication user account. :用于复制用户帐户的身份验证插件的名称。If you do not specify this option, MySQL native authentication (the 如果不指定此选项,则假定使用MySQL原生身份验证(mysql_native_password
plugin) is assumed. mysql_native_password
插件)。This option acts as a hint to the server, and the donor for distributed recovery overrides it if a different plugin is associated with the user account on that server. 此选项充当对服务器的提示,如果服务器上的用户帐户与其他插件关联,分布式恢复的捐赠者将覆盖该选项。The authentication plugin used by default when you create user accounts in MySQL 8 is the caching SHA-2 authentication plugin (在MySQL 8中创建用户帐户时默认使用的身份验证插件是缓存SHA-2身份验证插件(caching_sha2_password
). caching_sha2_password
)。See Section 6.2.17, “Pluggable Authentication” for more information on authentication plugins.有关认证插件的更多信息,请参阅第6.2.17节,“可插拔认证”。
These credentials are used for distributed recovery on the 这些凭据用于group_replication_recovery
channel. group_replication_recovery
通道上的分布式恢复。When you specify user credentials on 在START GROUP_REPLICATION
, the credentials are saved in memory only, and are removed by a STOP GROUP_REPLICATION
statement or server shutdown. START GROUP_REPLICATION
上指定用户凭据时,这些凭据仅保存在内存中,并通过STOP GROUP_REPLICATION
语句或服务器关闭来删除。You must issue a 必须发出START GROUP_REPLICATION
statement to provide the credentials again. START GROUP_REPLICATION
语句才能再次提供凭据。This method is therefore not compatible with starting Group Replication automatically on server start, as specified by the 因此,此方法与在服务器启动时自动启动组复制不兼容,这是由group_replication_start_on_boot
system variable.group_replication_start_on_boot
系统变量指定的。
User credentials specified on 使用START GROUP_REPLICATION
take precedence over any user credentials set for the group_replication_recovery
channel using a CHANGE REPLICATION SOURCE TO
statement (from MySQL 8.0.23) or CHANGE MASTER TO
statement (before MySQL 8.0.23). CHANGE REPLICATION SOURCE TO
语句(从MySQL 8.0.23开始)或CHANGE MASTER TO
语句(在MySQL 8.0.23之前),在START GROUP_REPLICATION
上指定的用户凭据优先于为group_replication_recovery
通道设置的任何用户凭据。Note that user credentials set using these statements are stored in the replication metadata repositories, and are used when 请注意,使用这些语句设置的用户凭据存储在复制元数据存储库中,并在没有用户凭据的情况下指定START GROUP_REPLICATION
is specified without user credentials, including automatic starts if the group_replication_start_on_boot
system variable is set to ON
. START GROUP_REPLICATION
时使用,包括在group_replication_start_on_boot
系统变量设置为ON
时自动启动。To gain the security benefits of specifying user credentials on 要获得在START GROUP_REPLICATION
, ensure that group_replication_start_on_boot
is set to OFF
(the default is ON
), and clear any user credentials previously set for the group_replication_recovery
channel, following the instructions in Section 18.6.3, “Securing Distributed Recovery Connections”.START GROUP_REPLICATION
时指定用户凭据的安全好处,请确保将group_replication_start_on_boot
设置为OFF
(默认设置为ON
),并按照第18.6.3节,“保护分布式恢复连接”中的说明,清除之前为group_replication_recovery
通道设置的所有用户凭据。