文档首页
MySQL 8.4 参考手册
8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 29 MySQL Performance Schema / 29.2 Performance Schema Build Configuration
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

29.2 Performance Schema 构建配置29.2 Performance Schema Build Configuration

Performance Schema 是必需的,并且总是编译在内。可以排除 Performance Schema 仪表的某些部分。例如,要排除阶段和语句仪表,请执行以下操作:The Performance Schema is mandatory and always compiled in. It is possible to exclude certain parts of the Performance Schema instrumentation. For example, to exclude stage and statement instrumentation, do this:

$> cmake . \
        -DDISABLE_PSI_STAGE=1 \
        -DDISABLE_PSI_STATEMENT=1

有关更多信息,请参阅 DISABLE_PSI_XXX CMake 选项的说明,见 第 2.8.7 节,“MySQL 源代码配置选项”。For more information, see the descriptions of the DISABLE_PSI_XXX CMake options in Section 2.8.7, “MySQL Source-Configuration Options”.

如果您在之前未配置 Performance Schema 的安装(或使用 Performance Schema 的旧版本且表缺失或过时)上安装 MySQL,则可能会出现此问题。此问题的一种迹象是在错误日志中出现类似如下的消息:If you install MySQL over a previous installation that was configured without the Performance Schema (or with an older version of the Performance Schema that has missing or out-of-date tables). One indication of this issue is the presence of messages such as the following in the error log:

[ERROR] Native table 'performance_schema'.'events_waits_history'
has the wrong structure
[ERROR] Native table 'performance_schema'.'events_waits_history_long'
has the wrong structure
...

要解决该问题,请执行 MySQL 升级程序。参见 第 3 章,升级 MySQL。To correct that problem, perform the MySQL upgrade procedure. See Chapter 3, Upgrading MySQL.

由于性能模式(Performance Schema)在构建服务器时就已配置,因此在 SHOW ENGINES 的输出中会出现 PERFORMANCE_SCHEMA 的行。这意味着性能模式是可用的,但并不意味着它已启用。要启用它,必须在服务器启动时进行,如下一节所述。Because the Performance Schema is configured into the server at build time, a row for PERFORMANCE_SCHEMA appears in the output from SHOW ENGINES. This means that the Performance Schema is available, not that it is enabled. To enable it, you must do so at server startup, as described in the next section.