Documentation Home
MySQL 9.4 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 41.2Mb
PDF (A4) - 41.3Mb
Man Pages (TGZ) - 262.8Kb
Man Pages (Zip) - 368.8Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb


MySQL 9.4 Reference Manual  / ...  / Security  / MySQL Enterprise Data Masking  / MySQL Enterprise Data Masking Components  /  MySQL Enterprise Data Masking Component Installation

8.5.2.1 MySQL Enterprise Data Masking Component Installation

Components provide expanded access to MySQL Enterprise Data Masking functionality. Previously, MySQL implemented masking and de-identification capabilities as a plugin library file containing a plugin and several loadable functions. Before you begin the component installation, remove thedata_masking plugin and all of its loadable functions to avoid conflicts. For instructions, seeSection 8.5.3.1, “MySQL Enterprise Data Masking Plugin Installation”.

MySQL Enterprise Data Masking database table and components are:

  • masking_dictionaries table

    Purpose: A table that provides persistent storage for masking dictionaries and terms. While themysql system schema is the traditional storage option, creating a dedicated schema for this purpose is also permitted. A dedicated schema might be preferable for these reasons:

    • Themysql system schema is not backed up by a logical backup, such asmysqldump or load operations.

    • A dedicated schema makes outbound replication easier.

    • A user or role requires nomysql schema privileges when preforming related data-masking tasks in the dedicated schema.

  • component_masking component

    Purpose: The component implements the core of the masking functionality and exposes it as services.

    URN:file://component_masking

  • component_masking_functions component

    Purpose: The component exposes all functionality of thecomponent_masking component as loadable functions. Some of the functions require theMASKING_DICTIONARIES_ADMIN dynamic privilege.

    URN:file://component_masking_functions

If the components and functions are used on a replication source server, install them on all replica servers as well to avoid replication issues. While the components are loaded, information about them is available as described inSection 7.5.2, “Obtaining Component Information”. For general information about installing or uninstalling components, seeSection 7.5.1, “Installing and Uninstalling Components”.

MySQL Enterprise Data Masking supports these setup and removal procedures:

Install Using the mysql System Schema
Note

Consider using a dedicated schema to store data-masking dictionaries (seeInstall Using a Dedicated Schema).

To set up MySQL Enterprise Data Masking:

  1. Runmasking_functions_install.sql to add themasking_dictionaries table to themysql schema and install the components. The script is located in theshare directory of your MySQL installation.

    $> mysql -u root -p -D mysql <[path/]masking_functions_install.sqlEnter password:(enter root password here)
Install Using a Dedicated Schema

To set up MySQL Enterprise Data Masking:

  1. Create a database to store themasking_dictionaries table. For example, to usemask_db as the database name, execute this statement:

    $> mysql -u root -p -e "CREATE DATABASE IF NOT EXISTS mask_db"Enter password:(enter root password here)
  2. Runmasking_functions_install.sql to add themasking_dictionaries table to themask_db schema and install the components. The script is located in theshare directory of your MySQL installation.

    $> mysql -u root -p -D mask_db <[path/]masking_functions_install.sqlEnter password:(enter root password here)
  3. Set and persist themask_db schema at startup by preceding thecomponent_masking.masking_database read-only variable name by thePERSIST_ONLY keyword.

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

    After modifying the variable, restart the server to cause the new setting to take effect.

Uninstall MySQL Enterprise Data Masking Components

To remove MySQL Enterprise Data Masking when using themysql system schema:

  1. Runmasking_functions_uninstall.sql to remove themasking_dictionaries table from the appropriate schema and uninstall the components. The script is located in theshare directory of your MySQL installation. The example here specifies themysql database.

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

To remove MySQL Enterprise Data Masking when using a dedicated schema:

  1. Runmasking_functions_uninstall.sql to remove themasking_dictionaries table from the appropriate schema and uninstall the components. The script is located in theshare directory of your MySQL installation. The example here specifies themask_db database.

    $> mysql -u root -p -D mask_db <[path/]masking_functions_uninstall.sqlEnter password:(enter root password here)
  2. Stop persisting thecomponent_masking.masking_database variable.

    $> mysql -u root -p -e "RESET PERSIST component_masking.masking_database"Enter password:(enter root password here)
  3. [Optional] Drop the dedicated schema to ensure that it is not used for other purposes.

    DROP DATABASE mask_db;