<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="macos-installation-notes">
      </a>
      2.4.1 General Notes on Installing MySQL on macOS
     </h3>
    </div>
   </div>
  </div>
  <p>
   You should keep the following issues and notes in mind:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <span class="bold">
       <strong>
        Other MySQL installations
       </strong>
      </span>
      :
          The installation procedure does not recognize MySQL
          installations by package managers such as Homebrew. The
          installation and upgrade process is for MySQL packages
          provided by us. If other installations are present, then
          consider stopping them before executing this installer to
          avoid port conflicts.
     </p>
     <p>
      <span class="bold">
       <strong>
        Homebrew
       </strong>
      </span>
      : For example, if you
          installed MySQL Server using Homebrew to its default location
          then the MySQL installer installs to a different location and
          won't upgrade the version from Homebrew. In this scenario you
          would end up with multiple MySQL installations that, by
          default, attempt to use the same ports. Stop the other MySQL
          Server instances before running this installer, such as
          executing
      <span class="emphasis">
       <em>
        brew services stop mysql
       </em>
      </span>
      to
          stop the Homebrew's MySQL service.
     </p>
    </li>
    <li class="listitem">
     <p>
      <span class="bold">
       <strong>
        Launchd
       </strong>
      </span>
      : A launchd daemon is
          installed that alters MySQL configuration options. Consider
          editing it if needed, see the documentation below for
          additional information. Also, macOS 10.10 removed startup item
          support in favor of launchd daemons. The optional MySQL
          preference pane under macOS
      <span class="guilabel">
       System
          Preferences
      </span>
      uses the launchd daemon.
     </p>
    </li>
    <li class="listitem">
     <p>
      <span class="bold">
       <strong>
        Users
       </strong>
      </span>
      : You may need (or want)
          to create a specific
      <code class="literal">
       mysql
      </code>
      user to own the
          MySQL directory and data. You can do this through the
      <span class="command">
       <strong>
        Directory Utility
       </strong>
      </span>
      , and the
      <code class="literal">
       mysql
      </code>
      user should already exist. For use in
          single user mode, an entry for
      <code class="literal">
       _mysql
      </code>
      (note
          the underscore prefix) should already exist within the system
      <code class="filename">
       /etc/passwd
      </code>
      file.
     </p>
    </li>
    <li class="listitem">
     <p>
      <span class="bold">
       <strong>
        Data
       </strong>
      </span>
      : Because the MySQL
          package installer installs the MySQL contents into a version
          and platform specific directory, you can use this to upgrade
          and migrate your database between versions. You need either to
          copy the
      <code class="filename">
       data
      </code>
      directory from the old
          version to the new version, or to specify an alternative
      <code class="option">
       datadir
      </code>
      value to set location of the data
          directory. By default, the MySQL directories are installed
          under
      <code class="filename">
       /usr/local/
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <span class="bold">
       <strong>
        Aliases
       </strong>
      </span>
      : You might want to
          add aliases to your shell's resource file to make it easier to
          access commonly used programs such as
      <a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
       <span class="command">
        <strong>
         mysql
        </strong>
       </span>
      </a>
      and
      <a class="link" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
       <span class="command">
        <strong>
         mysqladmin
        </strong>
       </span>
      </a>
      from the command line. The
          syntax for
      <span class="command">
       <strong>
        bash
       </strong>
      </span>
      is:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa55902438"><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">alias mysql<span class="token attr-value"><span class="token punctuation">=</span>/usr/local/mysql/bin/mysql</span>
alias mysqladmin<span class="token attr-value"><span class="token punctuation">=</span>/usr/local/mysql/bin/mysqladmin</span></code></pre>
     </div>
     <p>
      For
      <span class="command">
       <strong>
        tcsh
       </strong>
      </span>
      , use:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa44753180"><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">alias mysql /usr/local/mysql/bin/mysql
alias mysqladmin /usr/local/mysql/bin/mysqladmin</code></pre>
     </div>
     <p>
      Even better, add
      <code class="literal">
       /usr/local/mysql/bin
      </code>
      to
          your
      <code class="literal">
       PATH
      </code>
      environment variable. You can do
          this by modifying the appropriate startup file for your shell.
          For more information, see
      <a class="xref" href="invoking-programs.html" title="6.2.1 Invoking MySQL Programs">
       Section 6.2.1, “Invoking MySQL Programs”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <span class="bold">
       <strong>
        Removing
       </strong>
      </span>
      : After you have
          copied over the MySQL database files from the previous
          installation and have successfully started the new server, you
          should consider removing the old installation files to save
          disk space. Additionally, you should also remove older
          versions of the Package Receipt directories located in
      <code class="filename">
       /Library/Receipts/mysql-
       <em class="replaceable">
        <code>
         VERSION
        </code>
       </em>
       .pkg
      </code>
      .
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
