文件首頁
MySQL 8.4 參考手冊
相關文件 下載本手冊
PDF (美式信紙) - 39.9Mb
PDF (A4) - 40.0Mb
Man Pages (TGZ) - 258.5Kb
Man Pages (Zip) - 365.5Kb
資訊 (Gzip) - 4.0Mb
資訊 (Zip) - 4.0Mb


MySQL 8.4 參考手冊  /  ...  /  MySQL Enterprise 資料遮罩和去識別元件安裝

8.5.2.1 MySQL Enterprise 資料遮罩和去識別元件安裝

元件提供對 MySQL Enterprise 資料遮罩和去識別功能的擴充存取權。先前,MySQL 將遮罩和去識別功能實作為一個外掛程式程式庫檔案,其中包含一個外掛程式和數個可載入的函式。在您開始元件安裝之前,請移除 data_masking 外掛程式及其所有可載入的函式,以避免衝突。如需指示,請參閱第 8.5.3.1 節:「MySQL Enterprise 資料遮罩和去識別外掛程式安裝」

MySQL Enterprise 資料遮罩和去識別資料庫資料表和元件為

  • masking_dictionaries 資料表

    用途:一個資料表,提供遮罩字典和術語的持久儲存。雖然 mysql 系統結構描述是傳統的儲存選項,但也允許為此目的建立專用的結構描述。在這些情況下,專用的結構描述可能更佳

    • mysql 系統結構描述不會由邏輯備份(例如 mysqldump)或載入操作備份。

    • 專用的結構描述可讓輸出複製更容易。

    • 使用者或角色在專用的結構描述中執行相關資料遮罩工作時,不需要 mysql 結構描述權限。

  • component_masking 元件

    用途:該元件實作遮罩功能的核心,並將其公開為服務。

    URN:file://component_masking

  • component_masking_functions 元件

    用途:該元件將 component_masking 元件的所有功能公開為可載入的函式。某些函式需要 MASKING_DICTIONARIES_ADMIN 動態權限。

    URN:file://component_masking_functions

如果元件和函式用於複製來源伺服器,也請將它們安裝在所有複本伺服器上,以避免複製問題。當元件載入時,有關它們的資訊會如第 7.5.2 節:「取得元件資訊」中所述提供。如需安裝或解除安裝元件的一般資訊,請參閱第 7.5.1 節:「安裝和解除安裝元件」

MySQL Enterprise 資料遮罩和去識別支援下列設定和移除程序

使用 mysql 系統結構描述安裝
注意

建議使用專用的綱要來儲存資料遮罩字典(請參閱使用專用綱要安裝)。

設定 MySQL Enterprise Data Masking and De-Identification

  1. 執行 masking_functions_install.sql,將 masking_dictionaries 表格新增至 mysql 綱要,並安裝元件。此腳本位於您的 MySQL 安裝目錄的 share 目錄中。

    $> mysql -u root -p -D mysql < [path/]masking_functions_install.sql
    Enter password: (enter root password here)
使用專用綱要安裝

設定 MySQL Enterprise Data Masking and De-Identification

  1. 建立一個資料庫來儲存 masking_dictionaries 表格。例如,若要使用 mask_db 作為資料庫名稱,請執行此陳述式:

    $> mysql -u root -p -e "CREATE DATABASE IF NOT EXISTS mask_db"
    Enter password: (enter root password here)
  2. 執行 masking_functions_install.sql,將 masking_dictionaries 表格新增至 mask_db 綱要,並安裝元件。此腳本位於您的 MySQL 安裝目錄的 share 目錄中。

    $> mysql -u root -p -D mask_db < [path/]masking_functions_install.sql
    Enter password: (enter root password here)
  3. 在啟動時設定並持久化 mask_db 綱要,方法是在 component_masking.masking_database唯讀變數名稱前加上 PERSIST_ONLY 關鍵字。

    $> mysql -u root -p -e "SET PERSIST_ONLY component_masking.masking_database=mask_db"
    Enter password: (enter root password here)

    修改變數後,重新啟動伺服器,使新設定生效。

解除安裝 MySQL Enterprise Data Masking and De-Identification 元件

當使用 mysql 系統綱要時,移除 MySQL Enterprise Data Masking and De-Identification

  1. 執行 masking_functions_uninstall.sql,從適當的綱要中移除 masking_dictionaries 表格,並解除安裝元件。此腳本位於您的 MySQL 安裝目錄的 share 目錄中。此處的範例指定 mysql 資料庫。

    $> mysql -u root -p -D mysql < [path/]masking_functions_uninstall.sql
    Enter password: (enter root password here)

當使用專用綱要時,移除 MySQL Enterprise Data Masking and De-Identification

  1. 執行 masking_functions_uninstall.sql,從適當的綱要中移除 masking_dictionaries 表格,並解除安裝元件。此腳本位於您的 MySQL 安裝目錄的 share 目錄中。此處的範例指定 mask_db 資料庫。

    $> mysql -u root -p -D mask_db < [path/]masking_functions_uninstall.sql
    Enter password: (enter root password here)
  2. 停止持久化 component_masking.masking_database 變數。

    $> mysql -u root -p -e "RESET PERSIST component_masking.masking_database"
    Enter password: (enter root password here)
  3. [選用] 刪除專用綱要,以確保它不會用於其他用途。

    DROP DATABASE mask_db;