<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h2 class="title">
      <a name="windows-installation">
      </a>
      2.3 Installing MySQL on Microsoft Windows
     </h2>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="windows-choosing-package.html">
       2.3.1 Choosing an Installation Package
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-configurator.html">
       2.3.2 Configuration: Using MySQL Configurator
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="windows-install-archive.html">
       2.3.3 Configuration: Manually
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="windows-troubleshooting.html">
       2.3.4 Troubleshooting a Microsoft Windows MySQL Server Installation
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="windows-postinstallation.html">
       2.3.5 Windows Postinstallation Procedures
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="windows-restrictions.html">
       2.3.6 Windows Platform Restrictions
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <p>
   MySQL is available for Microsoft Windows 64-bit operating systems
    only. For supported Windows platform information, see
   <a class="ulink" href="https://www.mysql.com/support/supportedplatforms/database.html" target="_blank">
    https://www.mysql.com/support/supportedplatforms/database.html
   </a>
   .
  </p>
  <p>
   There are different methods to install MySQL on Microsoft Windows:
    the MSI, the standard binary distribution (packaged as a compressed
    file) containing all of the necessary files that you unpack, and
    source files to compile MySQL yourself. For related information, see
   <a class="xref" href="windows-choosing-package.html" title="2.3.1 Choosing an Installation Package">
    Section 2.3.1, “Choosing an Installation Package”
   </a>
   .
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    MySQL 8.4 Server requires the Microsoft Visual C++
      2019 Redistributable Package to run on Windows platforms. Users
      should make sure the package has been installed on the system
      before installing the server. The package is available at the
    <a class="ulink" href="http://www.microsoft.com/en-us/download/default.aspx" target="_blank">
     Microsoft
      Download Center
    </a>
    . Additionally, MySQL debug binaries
      require Visual Studio 2019.
   </p>
  </div>
  <h3>
   <a name="idm46045332497120">
   </a>
   Recommended MSI Installation Method
  </h3>
  <p>
   The simplest and recommended method is to download the MSI and let
    it install MySQL Server, and then use the MySQL Configurator it installs to
    configure MySQL:
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <p>
      Download the MSI from
      <a class="ulink" href="https://dev.mysql.com/downloads/" target="_top">
       https://dev.mysql.com/downloads/
      </a>
      and
        execute it. This installs the MySQL server, an associated
        MySQL Configurator application, and it adds related MySQL items to the
        Microsoft Windows Start menu under the
      <code class="literal">
       MySQL
      </code>
      group.
     </p>
    </li>
    <li class="listitem">
     <p>
      Upon completion, the installation wizard prompts to execute
      <a class="link" href="mysql-configurator.html" title="2.3.2 Configuration: Using MySQL Configurator">
       MySQL Configurator
      </a>
      . Execute it
        now (recommended) or later, or instead choose to manually
        configure MySQL.
     </p>
     <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
      <div class="admon-title">
       Note
      </div>
      <p>
       The MySQL server won't start until it's configured; it's
          recommended to execute the bundled MySQL Configurator immediately after
          the MSI.
      </p>
     </div>
    </li>
   </ol>
  </div>
  <p>
   MySQL is now installed. If you used MySQL Configurator to configure MySQL as
    a Windows service, then Windows automatically starts the MySQL
    server every time you restart the system. Also, the MSI installs the
    MySQL Configurator application on the local host, which you can use later to
    reconfigure MySQL server. It and other MySQL start up menu items
    were added by the MSI.
  </p>
  <h3>
   <a name="idm46045332488928">
   </a>
   MySQL Installation Layout on Microsoft Windows
  </h3>
  <p>
   For MySQL 8.4 on Windows, the default installation
    directory is
   <code class="filename">
    C:\Program Files\MySQL\MySQL Server
    8.4
   </code>
   for installations using the MSI,
    although the MSI
   <span class="guilabel">
    Custom
   </span>
   setup type allows using
    a different location. If you use the ZIP archive method to install
    MySQL, install it there are elsewhere, such as
   <code class="filename">
    C:\mysql
   </code>
   . Regardless, the layout of the
    subdirectories remains the same.
  </p>
  <p>
   All of the files are located within this parent directory using the
    structure shown in the following table.
  </p>
  <div class="table">
   <a name="idm46045332484784">
   </a>
   <p class="title">
    <b>
     Table 2.4 Default MySQL Installation Layout for Microsoft Windows
    </b>
   </p>
   <div class="table-contents">
    <table>
     <colgroup>
      <col style="width: 30%"/>
      <col style="width: 40%"/>
      <col style="width: 30%"/>
     </colgroup>
     <thead>
      <tr>
       <th scope="col">
        Directory
       </th>
       <th scope="col">
        Contents of Directory
       </th>
       <th scope="col">
        Notes
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <th scope="row">
        <code class="filename">
         bin
        </code>
       </th>
       <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>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="filename">
         %PROGRAMDATA%\MySQL\MySQL Server 8.4\
        </code>
       </th>
       <td>
        Log files, databases
       </td>
       <td>
        The Windows system variable
        <code class="varname">
         %PROGRAMDATA%
        </code>
        defaults to
        <code class="filename">
         C:\ProgramData
        </code>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="filename">
         docs
        </code>
       </th>
       <td>
        Release documentation
       </td>
       <td>
        With the MSI, use the
        <code class="literal">
         Custom
        </code>
        type to include this
          optional component.
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="filename">
         include
        </code>
       </th>
       <td>
        Include (header) files
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="filename">
         lib
        </code>
       </th>
       <td>
        Libraries
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="filename">
         share
        </code>
       </th>
       <td>
        Miscellaneous support files, including error messages, character set
          files, sample configuration files, SQL for database
          installation
       </td>
       <td>
       </td>
      </tr>
     </tbody>
    </table>
   </div>
  </div>
  <br class="table-break"/>
  <h3>
   <a name="idm46045332452368">
   </a>
   Silent Installation Methods
  </h3>
  <p>
   Use the standard
   <a class="ulink" href="https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/msiexec#install-options" target="_blank">
    msiexec
   </a>
   options for a silent installation. This example includes
   <code class="literal">
    /i
   </code>
   for a normal installation,
   <code class="literal">
    /qn
   </code>
   to not show a GUI and to avoid user
    interaction, and
   <code class="literal">
    /lv
   </code>
   to write verbose
    installation output to a new log file target. Execute the
    installation as Administrator from the command-line, for example:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa79196620"><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"><span class="token prompt">$&gt; </span><span class="token command">msiexec</span> /i <span class="token atrule"></span><em class="replaceable"><span class="token atrule">"C:\mysql\mysql-8.4.3-winx64.msi"</span> /qn /lv <span class="token atrule">"C:\mysql\install.log"</span></em><span class="token atrule"></span></code></pre>
  </div>
  <p>
   The MSI also supports
   <code class="literal">
    INSTALLDIR
   </code>
   to optionally
    override the default installation directory path to a non-default
    location. The following example installs MySQL to
   <code class="filename">
    C:\mysql\
   </code>
   instead of
   <code class="filename">
    C:\Program
    Files\MySQL\MySQL Server 8.4\
   </code>
   :
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa55667658"><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"><span class="token prompt">$&gt; </span><span class="token command">msiexec</span> <em class="replaceable"> /i <span class="token atrule">"C:\mysql\mysql-8.4-winx64.msi"</span> /qn /lv <span class="token atrule">"C:\mysql\install.log"</span> INSTALLDIR=<span class="token atrule">"C:\mysql"</span></em><span class="token atrule"></span></code></pre>
  </div>
  <h3>
   <a name="idm46045332442272">
   </a>
   Additional Installation Information
  </h3>
  <p>
   By default, MySQL Configurator sets up the MySQL server as a Windows service.
    By using a service, you can monitor and control the operation of the
    server through the standard Windows service management tools. For
    related information about manually setting up the Windows service,
    see
   <a class="xref" href="windows-start-service.html" title="2.3.3.8 Starting MySQL as a Windows Service">
    Section 2.3.3.8, “Starting MySQL as a Windows Service”
   </a>
   .
  </p>
  <p>
   To accommodate the
   <a class="link" href="restart.html" title="15.7.8.8 RESTART Statement">
    <code class="literal">
     RESTART
    </code>
   </a>
   statement,
    the MySQL server forks when run as a service or standalone, to
    enable a monitor process to supervise the server process. In this
    case, there are two
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   processes. If
   <a class="link" href="restart.html" title="15.7.8.8 RESTART Statement">
    <code class="literal">
     RESTART
    </code>
   </a>
   capability is not required,
    the server can be started with the
   <a class="link" href="server-options.html#option_mysqld_no-monitor">
    <code class="option">
     --no-monitor
    </code>
   </a>
   option. See
   <a class="xref" href="restart.html" title="15.7.8.8 RESTART Statement">
    Section 15.7.8.8, “RESTART Statement”
   </a>
   .
  </p>
  <p>
   Generally, you should install MySQL on Windows using an account that
    has administrator rights. Otherwise, you may encounter problems with
    certain operations such as editing the
   <code class="literal">
    PATH
   </code>
   environment variable or accessing the
   <span class="command">
    <strong>
     Service Control
    Manager
    </strong>
   </span>
   . When installed, MySQL does not need to be
    executed using a user with Administrator privileges.
  </p>
  <p>
   For a list of limitations on the use of MySQL on the Windows
    platform, see
   <a class="xref" href="windows-restrictions.html" title="2.3.6 Windows Platform Restrictions">
    Section 2.3.6, “Windows Platform Restrictions”
   </a>
   .
  </p>
  <p>
   In addition to the MySQL Server package, you may need or want
    additional components to use MySQL with your application or
    development environment. These include, but are not limited to:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      To connect to the MySQL server using ODBC, you must have a
        Connector/ODBC driver. For more information, including
        installation and configuration instructions, see
      <a class="ulink" href="/doc/connector-odbc/en/" target="_top">
       MySQL Connector/ODBC Developer Guide
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      To use MySQL server with .NET applications, you must have the
        Connector/NET driver. For more information, including installation and
        configuration instructions, see
      <a class="ulink" href="/doc/connector-net/en/" target="_top">
       MySQL Connector/NET Developer Guide
      </a>
      .
     </p>
    </li>
   </ul>
  </div>
  <p>
   MySQL distributions for Windows can be downloaded from
   <a class="ulink" href="https://dev.mysql.com/downloads/" target="_top">
    https://dev.mysql.com/downloads/
   </a>
   . See
   <a class="xref" href="getting-mysql.html" title="2.1.3 How to Get MySQL">
    Section 2.1.3, “How to Get MySQL”
   </a>
   .
  </p>
  <p>
   MySQL for Windows is available in several distribution formats,
    detailed here. Generally speaking, you should use the MSI to install
    MySQL server and MySQL Configurator to configure it. The MSI is simpler to
    use than the compressed file, and you need no additional tools to
    get MySQL up and running. MySQL Configurator automatically configures MySQL
    Server, creates an options file, starts the server, enables you to
    create default user accounts, and more. For more information on
    choosing a package, see
   <a class="xref" href="windows-choosing-package.html" title="2.3.1 Choosing an Installation Package">
    Section 2.3.1, “Choosing an Installation Package”
   </a>
   .
  </p>
  <h3>
   <a name="idm46045332422480">
   </a>
   MySQL on Windows Considerations
  </h3>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <span class="bold">
       <strong>
        Large Table Support
       </strong>
      </span>
     </p>
     <p>
      If you need tables with a size larger than 4GB, install MySQL on
        an NTFS or newer file system. Do not forget to use
      <code class="literal">
       MAX_ROWS
      </code>
      and
      <code class="literal">
       AVG_ROW_LENGTH
      </code>
      when you create tables. See
      <a class="xref" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
       Section 15.1.20, “CREATE TABLE Statement”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <span class="bold">
       <strong>
        MySQL and Virus Checking
        Software
       </strong>
      </span>
     </p>
     <p>
      Virus-scanning software such as Norton/Symantec Anti-Virus on
        directories containing MySQL data and temporary tables can cause
        issues, both in terms of the performance of MySQL and the
        virus-scanning software misidentifying the contents of the files
        as containing spam. This is due to the fingerprinting mechanism
        used by the virus-scanning software, and the way in which MySQL
        rapidly updates different files, which may be identified as a
        potential security risk.
     </p>
     <p>
      After installing MySQL Server, it is recommended that you
        disable virus scanning on the main directory
        (
      <a class="link" href="server-system-variables.html#sysvar_datadir">
       <code class="literal">
        datadir
       </code>
      </a>
      ) used to store your
        MySQL table data. There is usually a system built into the
        virus-scanning software to enable specific directories to be
        ignored.
     </p>
     <p>
      In addition, by default, MySQL creates temporary files in the
        standard Windows temporary directory. To prevent the temporary
        files also being scanned, configure a separate temporary
        directory for MySQL temporary files and add this directory to
        the virus scanning exclusion list. To do this, add a
        configuration option for the
      <a class="link" href="server-options.html#option_mysqld_tmpdir">
       <code class="option">
        tmpdir
       </code>
      </a>
      parameter to your
      <code class="filename">
       my.ini
      </code>
      configuration file. For more
        information, see
      <a class="xref" href="windows-create-option-file.html" title="2.3.3.2 Creating an Option File">
       Section 2.3.3.2, “Creating an Option File”
      </a>
      .
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
