MySQL 安装过程的一部分是数据目录的初始化(参见 第 2.9.1 节,“初始化数据目录”)。在数据目录初始化期间,MySQL 会创建应视为保留的用户账户:One part of the MySQL installation process is data directory initialization (see Section 2.9.1, “Initializing the Data Directory”). During data directory initialization, MySQL creates user accounts that should be considered reserved:
'root'@'localhost:用于管理目的。该账户具有所有权限,是一个系统账户,可以执行任何操作。'root'@'localhost: Used for administrative purposes. This account has all privileges, is a system account, and can perform any operation.严格来说,这个账户名并不是保留名,因为在一些安装中,会将
root账户重命名为其他名称,以避免暴露一个具有高度权限且众所周知的账户名。Strictly speaking, this account name is not reserved, in the sense that some installations rename therootaccount to something else to avoid exposing a highly privileged account with a well-known name.'mysql.sys'@'localhost':用作sys模式对象的DEFINER。使用mysql.sys账户可以避免 DBA 重命名或删除root账户时出现的问题。此账户已被锁定,因此无法用于客户端连接。'mysql.sys'@'localhost': Used as theDEFINERforsysschema objects. Use of themysql.sysaccount avoids problems that occur if a DBA renames or removes therootaccount. This account is locked so that it cannot be used for client connections.'mysql.session'@'localhost':由插件内部使用以访问服务器。该账户已被锁定,因此不能用于客户端连接。该账户是系统账户。'mysql.session'@'localhost': Used internally by plugins to access the server. This account is locked so that it cannot be used for client connections. The account is a system account.'mysql.infoschema'@'localhost':用作INFORMATION_SCHEMA视图的DEFINER。使用mysql.infoschema账户可以避免在 DBA 重命名或删除 root 账户时出现的问题。该账户已被锁定,因此不能用于客户端连接。'mysql.infoschema'@'localhost': Used as theDEFINERforINFORMATION_SCHEMAviews. Use of themysql.infoschemaaccount avoids problems that occur if a DBA renames or removes the root account. This account is locked so that it cannot be used for client connections.