6.4.7.2 Installing or Uninstalling MySQL Enterprise Data Masking and De-Identification
This section describes how to install or uninstall MySQL Enterprise Data Masking and De-Identification, which is implemented as a plugin library file containing a plugin and user-defined functions (UDFs). For general information about installing or uninstalling plugins and UDFs, see Section 5.5.1, “Installing and Uninstalling Plugins”, and Section 5.6.2, “Installing and Uninstalling User-Defined Functions”.
To be usable by the server, the plugin library file must be located in the MySQL plugin directory (the directory named by the plugin_dir
system variable). If necessary, configure the plugin directory location by setting the value of plugin_dir
at server startup.
The plugin library file base name is data_masking
. The file name suffix differs per platform (for example, .so
for Unix and Unix-like systems, .dll
for Windows).
To install the MySQL Enterprise Data Masking and De-Identification plugin and UDFs, use the INSTALL PLUGIN
and CREATE FUNCTION
statements, adjusting the .so
suffix for your platform as necessary:
INSTALL PLUGIN data_masking SONAME 'data_masking.so';
CREATE FUNCTION gen_blacklist RETURNS STRING
SONAME 'data_masking.so';
CREATE FUNCTION gen_dictionary RETURNS STRING
SONAME 'data_masking.so';
CREATE FUNCTION gen_dictionary_drop RETURNS STRING
SONAME 'data_masking.so';
CREATE FUNCTION gen_dictionary_load RETURNS STRING
SONAME 'data_masking.so';
CREATE FUNCTION gen_range RETURNS INTEGER
SONAME 'data_masking.so';
CREATE FUNCTION gen_rnd_email RETURNS STRING
SONAME 'data_masking.so';
CREATE FUNCTION gen_rnd_pan RETURNS STRING
SONAME 'data_masking.so';
CREATE FUNCTION gen_rnd_ssn RETURNS STRING
SONAME 'data_masking.so';
CREATE FUNCTION gen_rnd_us_phone RETURNS STRING
SONAME 'data_masking.so';
CREATE FUNCTION mask_inner RETURNS STRING
SONAME 'data_masking.so';
CREATE FUNCTION mask_outer RETURNS STRING
SONAME 'data_masking.so';
CREATE FUNCTION mask_pan RETURNS STRING
SONAME 'data_masking.so';
CREATE FUNCTION mask_pan_relaxed RETURNS STRING
SONAME 'data_masking.so';
CREATE FUNCTION mask_ssn RETURNS STRING
SONAME 'data_masking.so';
If the plugin and UDFs are used on a master replication server, install them on all slave servers as well to avoid replication issues.
Once installed as just described, the plugin and UDFs remain installed until uninstalled. To remove them, use the UNINSTALL PLUGIN
and DROP FUNCTION
statements:
UNINSTALL PLUGIN data_masking;
DROP FUNCTION gen_blacklist;
DROP FUNCTION gen_dictionary;
DROP FUNCTION gen_dictionary_drop;
DROP FUNCTION gen_dictionary_load;
DROP FUNCTION gen_range;
DROP FUNCTION gen_rnd_email;
DROP FUNCTION gen_rnd_pan;
DROP FUNCTION gen_rnd_ssn;
DROP FUNCTION gen_rnd_us_phone;
DROP FUNCTION mask_inner;
DROP FUNCTION mask_outer;
DROP FUNCTION mask_pan;
DROP FUNCTION mask_pan_relaxed;
DROP FUNCTION mask_ssn;