<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="selinux-context-mysql-feature-ports">
      </a>
      8.7.5.2 Setting the TCP Port Context for MySQL Features
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045231541200">
  </a>
  <p>
   If you enable certain MySQL features, you might need to set the
        SELinux TCP port context for additional ports used by those
        features. If ports used by MySQL features do not have the
        correct SELinux context, the features might not function
        correctly.
  </p>
  <p>
   The following sections describe how to set port contexts for
        MySQL features. Generally, the same method can be used to set
        the port context for any MySQL features. For information about
        ports used by MySQL features, refer to the
   <a class="ulink" href="/doc/mysql-port-reference/en/" target="_top">
    MySQL Port Reference
   </a>
   .
  </p>
  <p>
   For MySQL 8.4, enabling
   <code class="literal">
    mysql_connect_any
   </code>
   is not required or
        recommended.
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-simple"><div class="docs-select-all right" id="sa67682942"><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-simple">setsebool <span class="token operator">-</span>P mysql_connect_any<span class="token operator">=</span>ON</code></pre>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="selinux-context-group-replication-port">
       </a>
       Setting the TCP Port Context for Group Replication
      </h5>
     </div>
    </div>
   </div>
   <a class="indexterm" name="idm46045231533504">
   </a>
   <p>
    If SELinux is enabled, you must set the port context for the
          Group Replication communication port, which is defined by the
    <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_local_address">
     <code class="literal">
      group_replication_local_address
     </code>
    </a>
    variable.
    <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
     <span class="command">
      <strong>
       mysqld
      </strong>
     </span>
    </a>
    must be able to bind to
          the Group Replication communication port and listen there.
          InnoDB Cluster relies on Group Replication so this applies
          equally to instances used in a cluster. To view ports
          currently used by MySQL, issue:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-simple"><div class="docs-select-all right" id="sa53826537"><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-simple">semanage port <span class="token operator">-</span>l <span class="token operator">|</span> grep mysqld</code></pre>
   </div>
   <p>
    Assuming the Group Replication communication port is 33061,
          set the port context by issuing:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-simple"><div class="docs-select-all right" id="sa74681659"><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-simple">semanage port <span class="token operator">-</span>a <span class="token operator">-</span>t mysqld_port_t <span class="token operator">-</span>p tcp 33061</code></pre>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="selinux-context-document-store-ports">
       </a>
       Setting the TCP Port Context for Document Store
      </h5>
     </div>
    </div>
   </div>
   <a class="indexterm" name="idm46045231524832">
   </a>
   <p>
    If SELinux is enabled, you must set the port context for the
          communication port used by X Plugin, which is defined by the
    <a class="link" href="x-plugin-options-system-variables.html#sysvar_mysqlx_port">
     <code class="literal">
      mysqlx_port
     </code>
    </a>
    variable.
    <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
     <span class="command">
      <strong>
       mysqld
      </strong>
     </span>
    </a>
    must be able to bind to the
          X Plugin communication port and listen there.
   </p>
   <p>
    Assuming the X Plugin communication port is 33060, set the
          port context by issuing:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-simple"><div class="docs-select-all right" id="sa91995107"><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-simple">semanage port <span class="token operator">-</span>a <span class="token operator">-</span>t mysqld_port_t <span class="token operator">-</span>p tcp 33060</code></pre>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="selinux-context-router-ports">
       </a>
       Setting the TCP Port Context for MySQL Router
      </h5>
     </div>
    </div>
   </div>
   <a class="indexterm" name="idm46045231517376">
   </a>
   <p>
    If SELinux is enabled, you must set the port context for the
          communication ports used by MySQL Router. Assuming the additional
          communication ports used by MySQL Router are the default 6446,
          6447, 64460 and 64470, on each instance set the port context
          by issuing:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-simple"><div class="docs-select-all right" id="sa39843038"><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-simple">semanage port <span class="token operator">-</span>a <span class="token operator">-</span>t mysqld_port_t <span class="token operator">-</span>p tcp 6446
semanage port <span class="token operator">-</span>a <span class="token operator">-</span>t mysqld_port_t <span class="token operator">-</span>p tcp 6447
semanage port <span class="token operator">-</span>a <span class="token operator">-</span>t mysqld_port_t <span class="token operator">-</span>p tcp 64460
semanage port <span class="token operator">-</span>a <span class="token operator">-</span>t mysqld_port_t <span class="token operator">-</span>p tcp 64470</code></pre>
   </div>
  </div>
 </div>
 <br/>
</div>
