<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h2 class="title">
      <a name="mysql-oci-marketplace-connecting">
      </a>
      34.4 Connecting
     </h2>
    </div>
   </div>
  </div>
  <p>
   This section describes the various connection methods for
      connecting to the deployed MySQL server on the OCI Compute
      Instance.
  </p>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h3 class="title">
       <a name="mysql-oci-marketplace-connecting-ssh">
       </a>
       Connecting with SSH
      </h3>
     </div>
    </div>
   </div>
   <p>
    This section gives some detail on connecting from a UNIX-like
        platform to the OCI Compute. For more information on connecting
        with SSH, see
    <a class="ulink" href="https://docs.oracle.com/en/cloud/iaas/compute-iaas-cloud/stcsg/accessing-oracle-linux-instance-using-ssh.html#GUID-D947E2CC-0D4C-43F4-B2A9-A517037D6C11" target="_blank">
     Accessing
        an Oracle Linux Instance Using SSH
    </a>
    and
    <a class="ulink" href="https://docs.cloud.oracle.com/iaas/Content/GSG/Tasks/testingconnection.htm" target="_blank">
     Connecting
        to Your Instance
    </a>
    .
   </p>
   <p>
    To connect to the Oracle Linux running on the Compute Instance
        with SSH, run the following command:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-simple"><div class="docs-select-all right" id="sa82733816"><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">ssh opc@<em class="replaceable">computeIP</em></code></pre>
   </div>
   <p>
    where
    <code class="literal">
     opc
    </code>
    is the compute user and
    <em class="replaceable">
     <code>
      computeIP
     </code>
    </em>
    is the IP address of your
        Compute Instance.
   </p>
   <p>
    To find the temporary root password created for the root user,
        run the following command:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa5254481"><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-terminal">sudo grep <span class="token atrule">'temporary password'</span> /var/log/mysqld<span class="token punctuation">.</span>log</code></pre>
   </div>
   <p>
    To change your default password, log in to the server using the
        generated, temporary password, using the following command:
    <code class="literal">
     mysql -uroot -p
    </code>
    . Then run the following:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa37994823"><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">ALTER</span> <span class="token keyword">USER</span> <span class="token string">'root'</span>@<span class="token string">'localhost'</span> <span class="token keyword">IDENTIFIED</span> <span class="token keyword">BY</span> <span class="token string">'MyNewPass4!'</span><span class="token punctuation">;</span></code></pre>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h3 class="title">
       <a name="mysql-oci-marketplace-connecting-mysqlclient">
       </a>
       Connecting with MySQL Client
      </h3>
     </div>
    </div>
   </div>
   <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Note
    </div>
    <p>
     To connect from your local MySQL client, you must first create
          on the MySQL server a user which allows remote login.
    </p>
   </div>
   <p>
    To connect to the MySQL Server from your local MySQL client, run
        the following command from your shell session:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-simple"><div class="docs-select-all right" id="sa30912652"><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">mysql <span class="token operator">-</span>uroot <span class="token operator">-</span>p <span class="token operator">-</span>h<em class="replaceable">computeIP</em></code></pre>
   </div>
   <p>
    where
    <em class="replaceable">
     <code>
      computeIP
     </code>
    </em>
    is the IP address of
        your Compute Instance.
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h3 class="title">
       <a name="mysql-oci-marketplace-connecting-mysqlshell">
       </a>
       Connecting with MySQL Shell
      </h3>
     </div>
    </div>
   </div>
   <p>
    To connect to the MySQL Server from your local MySQL Shell, run
        the following command to start your shell session:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa34165496"><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-terminal">mysqlsh root@<em class="replaceable">computeIP</em></code></pre>
   </div>
   <p>
    where
    <em class="replaceable">
     <code>
      computeIP
     </code>
    </em>
    is the IP address of
        your Compute Instance.
   </p>
   <p>
    For more information on MySQL Shell connections, see
    <a class="ulink" href="/doc/mysql-shell/8.4/en/mysql-shell-connections.html" target="_top">
     MySQL Shell Connections
    </a>
    .
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h3 class="title">
       <a name="mysql-oci-marketplace-connecting-workbench">
       </a>
       Connecting with Workbench
      </h3>
     </div>
    </div>
   </div>
   <p>
    To connect to the MySQL Server from MySQL Workbench, see
    <a class="ulink" href="/doc/workbench/en/wb-mysql-connections.html" target="_top">
     Connections in MySQL Workbench
    </a>
    .
   </p>
  </div>
 </div>
 <br/>
</div>
