文件首頁
MySQL 8.4 參考手冊
相關文件 下載本手冊
PDF (US Ltr) - 39.9Mb
PDF (A4) - 40.0Mb
Man Pages (TGZ) - 258.5Kb
Man Pages (Zip) - 365.5Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


MySQL 8.4 參考手冊  /  MySQL Performance Schema  /  Performance Schema 建置配置

29.2 Performance Schema 建置配置

Performance Schema 是強制性的,且始終編譯在內。可以排除 Performance Schema 檢測的某些部分。例如,若要排除階段和陳述式檢測,請執行此操作

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

如需更多資訊,請參閱第 2.8.7 節,「MySQL 原始碼組態選項」DISABLE_PSI_XXX CMake 選項的說明。

如果您在先前安裝的 MySQL 上安裝 MySQL,而該安裝設定時沒有 Performance Schema(或具有遺失或過時表格的舊版 Performance Schema)。此問題的一個跡象是錯誤日誌中存在如下訊息

[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

由於 Performance Schema 在建置時設定到伺服器中,因此 PERFORMANCE_SCHEMA 的資料列會出現在 SHOW ENGINES 的輸出中。這表示 Performance Schema 可用,而不是已啟用。若要啟用它,您必須在伺服器啟動時執行此操作,如下一節所述。