MySQL 8.4 Reference Manual Including MySQL NDB Cluster 8.4

2.3 Installing MySQL on Microsoft Windows

MySQL is available for Microsoft Windows 64-bit operating systems only. For supported Windows platform information, see https://www.mysql.com/support/supportedplatforms/database.html.

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 Section 2.3.1, “Choosing an Installation Package”.

Note

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 Microsoft Download Center. Additionally, MySQL debug binaries require Visual Studio 2019.

Recommended MSI Installation Method

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:

  1. Download the MSI from https://dev.mysql.com/downloads/ 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 MySQL group.

  2. Upon completion, the installation wizard prompts to execute MySQL Configurator. Execute it now (recommended) or later, or instead choose to manually configure MySQL.

    Note

    The MySQL server won't start until it's configured; it's recommended to execute the bundled MySQL Configurator immediately after the MSI.

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.

MySQL Installation Layout on Microsoft Windows

For MySQL 8.4 on Windows, the default installation directory is C:\Program Files\MySQL\MySQL Server 8.4 for installations using the MSI, although the MSI Custom setup type allows using a different location. If you use the ZIP archive method to install MySQL, install it there are elsewhere, such as C:\mysql. Regardless, the layout of the subdirectories remains the same.

All of the files are located within this parent directory using the structure shown in the following table.

Table 2.4 Default MySQL Installation Layout for Microsoft Windows

Directory Contents of Directory Notes
bin mysqld server, client, and utility programs
%PROGRAMDATA%\MySQL\MySQL Server 8.4\ Log files, databases The Windows system variable %PROGRAMDATA% defaults to C:\ProgramData.
docs Release documentation With the MSI, use the Custom type to include this optional component.
include Include (header) files
lib Libraries
share Miscellaneous support files, including error messages, character set files, sample configuration files, SQL for database installation

Additional Installation Information

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 Section 2.3.3.8, “Starting MySQL as a Windows Service”.

To accommodate the RESTART 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 mysqld processes. If RESTART capability is not required, the server can be started with the --no-monitor option. See Section 15.7.8.8, “RESTART Statement”.

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 PATH environment variable or accessing the Service Control Manager. When installed, MySQL does not need to be executed using a user with Administrator privileges.

For a list of limitations on the use of MySQL on the Windows platform, see Section 2.3.6, “Windows Platform Restrictions”.

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:

MySQL distributions for Windows can be downloaded from https://dev.mysql.com/downloads/. See Section 2.1.3, “How to Get MySQL”.

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 Section 2.3.1, “Choosing an Installation Package”.

MySQL on Windows Considerations