MySql 中文参考指南

Chapter 30 MySQL sys Schema

目录

Table of Contents

MySQL 9.0 包含 sys 架构,这是一组对象,它帮助 DBA 和开发人员解释性能架构收集的数据。 sys 构架对象可以用于典型的调整和诊断用例。该构架中的对象包括:

MySQL 9.0 includes the sys schema, a set of objects that helps DBAs and developers interpret data collected by the Performance Schema. sys schema objects can be used for typical tuning and diagnosis use cases. Objects in this schema include:

  1. Views that summarize Performance Schema data into more easily understandable form.

  2. Stored procedures that perform operations such as Performance Schema configuration and generating diagnostic reports.

  3. Stored functions that query Performance Schema configuration and provide formatting services.

对于新安装,如果你在 mysqld 中使用 —​initialize—​initialize-insecure 选项,则在数据目录初始化期间, sys 架构会默认安装。如果不需要这样做,你可以在初始化之后手动删除 sys 架构(如果不需要)。

For new installations, the sys schema is installed by default during data directory initialization if you use mysqld with the —​initialize or —​initialize-insecure option. If this is not desired, you can drop the sys schema manually after initialization if it is unneeded.

如果 sys 架构存在但没有 version 视图,则 MySQL 升级程序会产生一个错误,假设此视图的缺失表示用户创建的 sys 架构。要在此情况下升级,请先删除或重命名现有的 sys 架构。

The MySQL upgrade procedure produces an error if a sys schema exists but has no version view, on the assumption that absence of this view indicates a user-created sys schema. To upgrade in this case, remove or rename the existing sys schema first.

sys 架构对象有一个 DEFINER'mysql.sys'@'localhost' 。使用专用 mysql.sys 帐户可以避免如果 DBA 重命名或删除 root 帐户时发生的问题。

sys schema objects have a DEFINER of 'mysql.sys'@'localhost'. Use of the dedicated mysql.sys account avoids problems that occur if a DBA renames or removes the root account.