文件首頁
MySQL 9.0 參考手冊
相關文件 下載本手冊
PDF (美式信紙) - 40.0Mb
PDF (A4) - 40.1Mb
Man Pages (TGZ) - 258.2Kb
Man Pages (Zip) - 365.3Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


MySQL 9.0 參考手冊  /  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 安裝在先前未配置 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 可用,而不是已啟用。若要啟用它,您必須在伺服器啟動時執行此操作,如下一節所述。