<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="macos-installation-pkg">
      </a>
      2.4.2 Installing MySQL on macOS Using Native Packages
     </h3>
    </div>
   </div>
  </div>
  <p>
   The package is located inside a disk image
      (
   <code class="literal">
    .dmg
   </code>
   ) file that you first need to mount by
      double-clicking its icon in the Finder. It should then mount the
      image and display its contents.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    Before proceeding with the installation, be sure to stop all
        running MySQL server instances by using either the MySQL Manager
        Application (on macOS Server), the preference pane, or
    <a class="link" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
     <span class="command">
      <strong>
       mysqladmin shutdown
      </strong>
     </span>
    </a>
    on the command line.
   </p>
  </div>
  <p>
   To install MySQL using the package installer:
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <p>
      Download the disk image (
      <code class="filename">
       .dmg
      </code>
      ) file (the
          community version is available
      <a class="ulink" href="https://dev.mysql.com/downloads/mysql/" target="_top">
       here
      </a>
      ) that
          contains the MySQL package installer. Double-click the file to
          mount the disk image and see its contents.
     </p>
     <p>
      Double-click the MySQL installer package from the disk. It is
          named according to the version of MySQL you have downloaded.
          For example, for MySQL server 8.4.3 it might be
          named
      <code class="filename">
       mysql-8.4.3-macos-
       <em class="replaceable">
        <code>
         10.13-x86_64
        </code>
       </em>
       .pkg
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      The initial wizard introduction screen references the MySQL
          server version to install. Click
      <span class="guibutton">
       Continue
      </span>
      to begin the installation.
     </p>
     <p>
      The MySQL community edition shows a copy of the relevant GNU
          General Public License. Click
      <span class="guibutton">
       Continue
      </span>
      and then
      <span class="guibutton">
       Agree
      </span>
      to continue.
     </p>
    </li>
    <li class="listitem">
     <p>
      From the
      <span class="guilabel">
       Installation Type
      </span>
      page you can
          either click
      <span class="guibutton">
       Install
      </span>
      to execute the
          installation wizard using all defaults, click
      <span class="guibutton">
       Customize
      </span>
      to alter which components to
          install (MySQL server, MySQL Test, Preference Pane, Launchd
          Support -- all but MySQL Test are enabled by default).
     </p>
     <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
      <div class="admon-title">
       Note
      </div>
      <p>
       Although the
       <span class="guibutton">
        Change Install Location
       </span>
       option is visible, the installation location cannot be
            changed.
      </p>
     </div>
     <div class="figure">
      <a name="mac-installer-installation-customize-main">
      </a>
      <p class="title">
       <b>
        Figure 2.5 MySQL Package Installer Wizard: Customize
       </b>
      </p>
      <div class="figure-contents">
       <div class="mediaobject">
        <img alt="Customize shows three package name options: MySQL Server, MySQL Test, Preference Pane, and Launchd Support. All three options are checked." src="images/mac-installer-installation-type-customize.png" style="width: 100%; max-width: 688px;"/>
       </div>
      </div>
     </div>
     <br class="figure-break"/>
    </li>
    <li class="listitem">
     <p>
      Click
      <span class="guibutton">
       Install
      </span>
      to install MySQL Server.
          The installation process ends here if upgrading a current
          MySQL Server installation, otherwise follow the wizard's
          additional configuration steps for your new MySQL Server
          installation.
     </p>
    </li>
    <li class="listitem">
     <p>
      After a successful new MySQL Server installation, complete the
          configuration by defining the root password and enabling (or
          disabling) the MySQL server at startup.
     </p>
    </li>
    <li class="listitem">
     <p>
      Define a password for the root user, and also toggle whether
          MySQL Server should start after the configuration step is
          complete.
     </p>
    </li>
    <li class="listitem">
     <p>
      <span class="guilabel">
       Summary
      </span>
      is the final step and references
          a successful and complete MySQL Server installation.
      <span class="guibutton">
       Close
      </span>
      the wizard.
     </p>
    </li>
   </ol>
  </div>
  <p>
   MySQL server is now installed. If you chose to not start MySQL,
      then use either launchctl from the command line or start MySQL by
      clicking "Start" using the MySQL preference pane. For additional
      information, see
   <a class="xref" href="macos-installation-launchd.html" title="2.4.3 Installing and Using the MySQL Launch Daemon">
    Section 2.4.3, “Installing and Using the MySQL Launch Daemon”
   </a>
   , and
   <a class="xref" href="macos-installation-prefpane.html" title="2.4.4 Installing and Using the MySQL Preference Pane">
    Section 2.4.4, “Installing and Using the MySQL Preference Pane”
   </a>
   . Use the MySQL
      Preference Pane or launchd to configure MySQL to automatically
      start at bootup.
  </p>
  <p>
   When installing using the package installer, the files are
      installed into a directory within
   <code class="filename">
    /usr/local
   </code>
   matching the name of the installation version and platform. For
      example, the installer file
   <code class="filename">
    mysql-8.4.3-
    <em class="replaceable">
     <code>
      macos10.15-x86_64.dmg
     </code>
    </em>
   </code>
   installs MySQL into
   <code class="filename">
    /usr/local/mysql-8.4.3-macos10.15-x86_64/
   </code>
   with a symlink to
   <code class="filename">
    /usr/local/mysql
   </code>
   . The following table shows
      the layout of this MySQL installation directory.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    The macOS installation process does not create nor install a
        sample
    <code class="filename">
     my.cnf
    </code>
    MySQL configuration file.
   </p>
  </div>
  <div class="table">
   <a name="mysql-installation-layout-macos">
   </a>
   <p class="title">
    <b>
     Table 2.6 MySQL Installation Layout on macOS
    </b>
   </p>
   <div class="table-contents">
    <table>
     <colgroup>
      <col style="width: 45%"/>
      <col style="width: 55%"/>
     </colgroup>
     <thead>
      <tr>
       <th>
        Directory
       </th>
       <th>
        Contents of Directory
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <td>
        <code class="filename">
         bin
        </code>
       </td>
       <td>
        <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
         <span class="command">
          <strong>
           mysqld
          </strong>
         </span>
        </a>
        server, client and utility programs
       </td>
      </tr>
      <tr>
       <td>
        <code class="filename">
         data
        </code>
       </td>
       <td>
        Log files, databases, where
        <code class="filename">
         /usr/local/mysql/data/mysqld.local.err
        </code>
        is the default error log
       </td>
      </tr>
      <tr>
       <td>
        <code class="filename">
         docs
        </code>
       </td>
       <td>
        Helper documents, like the Release Notes and build information
       </td>
      </tr>
      <tr>
       <td>
        <code class="filename">
         include
        </code>
       </td>
       <td>
        Include (header) files
       </td>
      </tr>
      <tr>
       <td>
        <code class="filename">
         lib
        </code>
       </td>
       <td>
        Libraries
       </td>
      </tr>
      <tr>
       <td>
        <code class="filename">
         man
        </code>
       </td>
       <td>
        Unix manual pages
       </td>
      </tr>
      <tr>
       <td>
        <code class="filename">
         mysql-test
        </code>
       </td>
       <td>
        MySQL test suite ('MySQL Test' is disabled by default during the
            installation process when using the installer package (DMG))
       </td>
      </tr>
      <tr>
       <td>
        <code class="filename">
         share
        </code>
       </td>
       <td>
        Miscellaneous support files, including error messages,
        <code class="filename">
         dictionary.txt
        </code>
        , and rewriter SQL
       </td>
      </tr>
      <tr>
       <td>
        <code class="filename">
         support-files
        </code>
       </td>
       <td>
        Support scripts, such as
        <code class="filename">
         mysqld_multi.server
        </code>
        ,
        <code class="filename">
         mysql.server
        </code>
        , and
        <code class="filename">
         mysql-log-rotate
        </code>
        .
       </td>
      </tr>
      <tr>
       <td>
        <code class="filename">
         /tmp/mysql.sock
        </code>
       </td>
       <td>
        Location of the MySQL Unix socket
       </td>
      </tr>
     </tbody>
    </table>
   </div>
   <div class="table-contents">
    <table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 401px; width: 739px;">
     <thead>
      <tr>
       <th style="width: 332.094px;">
        Directory
       </th>
       <th style="width: 405.906px;">
        Contents of Directory
       </th>
      </tr>
     </thead>
    </table>
   </div>
  </div>
  <br class="table-break"/>
 </div>
 <br/>
</div>
