<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="data-masking-plugin-installation">
      </a>
      8.5.3.1 MySQL Enterprise Data Masking and De-Identification Plugin Installation
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045232497664">
  </a>
  <a class="indexterm" name="idm46045232496176">
  </a>
  <a class="indexterm" name="idm46045232494688">
  </a>
  <a class="indexterm" name="idm46045232493200">
  </a>
  <p>
   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 several loadable functions. For general information
        about installing or uninstalling plugins and loadable functions,
        see
   <a class="xref" href="plugin-loading.html" title="7.6.1 Installing and Uninstalling Plugins">
    Section 7.6.1, “Installing and Uninstalling Plugins”
   </a>
   , and
   <a class="xref" href="function-loading.html" title="7.7.1 Installing and Uninstalling Loadable Functions">
    Section 7.7.1, “Installing and Uninstalling Loadable Functions”
   </a>
   .
  </p>
  <p>
   To be usable by the server, the plugin library file must be
        located in the MySQL plugin directory (the directory named by
        the
   <a class="link" href="server-system-variables.html#sysvar_plugin_dir">
    <code class="literal">
     plugin_dir
    </code>
   </a>
   system
        variable). If necessary, configure the plugin directory location
        by setting the value of
   <a class="link" href="server-system-variables.html#sysvar_plugin_dir">
    <code class="literal">
     plugin_dir
    </code>
   </a>
   at server startup.
  </p>
  <p>
   The plugin library file base name is
   <code class="literal">
    data_masking
   </code>
   . The file name suffix differs
        per platform (for example,
   <code class="filename">
    .so
   </code>
   for Unix and
        Unix-like systems,
   <code class="filename">
    .dll
   </code>
   for Windows).
  </p>
  <p>
   To install the MySQL Enterprise Data Masking and De-Identification plugin and functions, use the
   <a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
    <code class="literal">
     INSTALL PLUGIN
    </code>
   </a>
   and
   <a class="link" href="create-function.html" title="15.1.14 CREATE FUNCTION Statement">
    <code class="literal">
     CREATE FUNCTION
    </code>
   </a>
   statements,
        adjusting the
   <code class="filename">
    .so
   </code>
   suffix for your platform
        as necessary:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa48046319"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">INSTALL</span> <span class="token keyword">PLUGIN</span> data_masking <span class="token keyword">SONAME</span> <span class="token string">'data_masking.so'</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">FUNCTION</span> gen_blocklist <span class="token keyword">RETURNS</span> <span class="token keyword">STRING</span>
  <span class="token keyword">SONAME</span> <span class="token string">'data_masking.so'</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">FUNCTION</span> gen_dictionary <span class="token keyword">RETURNS</span> <span class="token keyword">STRING</span>
  <span class="token keyword">SONAME</span> <span class="token string">'data_masking.so'</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">FUNCTION</span> gen_dictionary_drop <span class="token keyword">RETURNS</span> <span class="token keyword">STRING</span>
  <span class="token keyword">SONAME</span> <span class="token string">'data_masking.so'</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">FUNCTION</span> gen_dictionary_load <span class="token keyword">RETURNS</span> <span class="token keyword">STRING</span>
  <span class="token keyword">SONAME</span> <span class="token string">'data_masking.so'</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">FUNCTION</span> gen_range <span class="token keyword">RETURNS</span> <span class="token datatype">INTEGER</span>
  <span class="token keyword">SONAME</span> <span class="token string">'data_masking.so'</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">FUNCTION</span> gen_rnd_email <span class="token keyword">RETURNS</span> <span class="token keyword">STRING</span>
  <span class="token keyword">SONAME</span> <span class="token string">'data_masking.so'</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">FUNCTION</span> gen_rnd_pan <span class="token keyword">RETURNS</span> <span class="token keyword">STRING</span>
  <span class="token keyword">SONAME</span> <span class="token string">'data_masking.so'</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">FUNCTION</span> gen_rnd_ssn <span class="token keyword">RETURNS</span> <span class="token keyword">STRING</span>
  <span class="token keyword">SONAME</span> <span class="token string">'data_masking.so'</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">FUNCTION</span> gen_rnd_us_phone <span class="token keyword">RETURNS</span> <span class="token keyword">STRING</span>
  <span class="token keyword">SONAME</span> <span class="token string">'data_masking.so'</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">FUNCTION</span> mask_inner <span class="token keyword">RETURNS</span> <span class="token keyword">STRING</span>
  <span class="token keyword">SONAME</span> <span class="token string">'data_masking.so'</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">FUNCTION</span> mask_outer <span class="token keyword">RETURNS</span> <span class="token keyword">STRING</span>
  <span class="token keyword">SONAME</span> <span class="token string">'data_masking.so'</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">FUNCTION</span> mask_pan <span class="token keyword">RETURNS</span> <span class="token keyword">STRING</span>
  <span class="token keyword">SONAME</span> <span class="token string">'data_masking.so'</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">FUNCTION</span> mask_pan_relaxed <span class="token keyword">RETURNS</span> <span class="token keyword">STRING</span>
  <span class="token keyword">SONAME</span> <span class="token string">'data_masking.so'</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">FUNCTION</span> mask_ssn <span class="token keyword">RETURNS</span> <span class="token keyword">STRING</span>
  <span class="token keyword">SONAME</span> <span class="token string">'data_masking.so'</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   If the plugin and functions are used on a replication source
        server, install them on all replica servers as well to avoid
        replication issues.
  </p>
  <p>
   Once installed as just described, the plugin and functions
        remain installed until uninstalled. To remove them, use the
   <a class="link" href="uninstall-plugin.html" title="15.7.4.6 UNINSTALL PLUGIN Statement">
    <code class="literal">
     UNINSTALL PLUGIN
    </code>
   </a>
   and
   <a class="link" href="drop-function.html" title="15.1.26 DROP FUNCTION Statement">
    <code class="literal">
     DROP FUNCTION
    </code>
   </a>
   statements:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa94701483"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">UNINSTALL</span> <span class="token keyword">PLUGIN</span> data_masking<span class="token punctuation">;</span>
<span class="token keyword">DROP</span> <span class="token keyword">FUNCTION</span> gen_blocklist<span class="token punctuation">;</span>
<span class="token keyword">DROP</span> <span class="token keyword">FUNCTION</span> gen_dictionary<span class="token punctuation">;</span>
<span class="token keyword">DROP</span> <span class="token keyword">FUNCTION</span> gen_dictionary_drop<span class="token punctuation">;</span>
<span class="token keyword">DROP</span> <span class="token keyword">FUNCTION</span> gen_dictionary_load<span class="token punctuation">;</span>
<span class="token keyword">DROP</span> <span class="token keyword">FUNCTION</span> gen_range<span class="token punctuation">;</span>
<span class="token keyword">DROP</span> <span class="token keyword">FUNCTION</span> gen_rnd_email<span class="token punctuation">;</span>
<span class="token keyword">DROP</span> <span class="token keyword">FUNCTION</span> gen_rnd_pan<span class="token punctuation">;</span>
<span class="token keyword">DROP</span> <span class="token keyword">FUNCTION</span> gen_rnd_ssn<span class="token punctuation">;</span>
<span class="token keyword">DROP</span> <span class="token keyword">FUNCTION</span> gen_rnd_us_phone<span class="token punctuation">;</span>
<span class="token keyword">DROP</span> <span class="token keyword">FUNCTION</span> mask_inner<span class="token punctuation">;</span>
<span class="token keyword">DROP</span> <span class="token keyword">FUNCTION</span> mask_outer<span class="token punctuation">;</span>
<span class="token keyword">DROP</span> <span class="token keyword">FUNCTION</span> mask_pan<span class="token punctuation">;</span>
<span class="token keyword">DROP</span> <span class="token keyword">FUNCTION</span> mask_pan_relaxed<span class="token punctuation">;</span>
<span class="token keyword">DROP</span> <span class="token keyword">FUNCTION</span> mask_ssn<span class="token punctuation">;</span></code></pre>
  </div>
 </div>
 <br/>
</div>
