MIDAS Knowledge Base MIDAS Knowledge Base

How to install & configure MySQL on Windows

This guide outlines how to install and configure MySQL Community Server on Windows. MySQL is a free, open-source relational database server.

The steps below apply to current 64-bit editions of Windows, including Windows 10, Windows 11, and Windows Server (2016 onwards).

This article forms part of our "How to install prerequisites needed for running a self-hosted edition of MIDAS from a Windows server" series, and applies to self-hosted installations of MIDAS booking software on Windows-based servers.

MIDAS requires either MySQL or MariaDB to be installed; this guide covers MySQL (instructions for installing MariaDB are also available). It assumes that you've already successfully completed our previous "How to install & configure Apache on a Windows server" guide.

This article is provided "as is" and is correct at time of writing. For further assistance installing or configuring MySQL, please refer to the vendor's own documentation and support.

Contents:


Step 1 - Download MySQL for Windows

MySQL for Windows may be downloaded from MySQL.com.

A free "MySQL Community Server" edition is available in both a "web" installer and a "standalone" installer:

MySQL Web and Standalone Installers for Windows

Choose either the "web" installer (which has smaller initial installer download size, but with additional components downloaded during install), or the "full" installer (which has a larger installer download size, but doesn't require downloading any additional components during install) and click "Download".

You'll then be offered the option to sign up for - or log in to - an Oracle Web account, but you can skip this step by clicking the "No thanks just start my download" link:

Download MySQL Without Registering

MySQL is updated regularly, so the exact version offered will change over time. Simply download the current stable release.


Step 2 - Install MySQL

Run the MySQL Installer, read & accept the License Agreement, and choose a setup type:

MySQL Setup Type

As a minimum, you'll need to install the MySQL server, so we'd suggest selecting the "Server only" option.

The installer will then download (in the case of the "web" installer) and then install the selected components:

MySQL Windows Installation

Once installation is complete, click "Next" to configure your MySQL server:

Configuring MySQL on Windows

Select the "Config Type" most applicable to your server. This should either be "Server Computer" in the case that you're installing MySQL on a server where other applications are installed/running, or "Dedicated Computer" in the case that the server you're installing MySQL on is to be dedicated to MySQL only and won't be running any other applications/services.

You can also specify "Connectivity" options on this screen. In most cases, you can leave these as the default (TCP/IP, Port 3306).

Click "Next" and you'll then be prompted to select an authentication method:

Setting authentication method during MySQL 8 install

The particular software environment and applications which will be using your MySQL server will determine which authentication method you select here. If in doubt, or for maximum compatibility, we advise selecting the "Use Legacy Authentication Method (Retain MySQL 5.x Compatibility)" option.

If you're installing a MySQL server for use with our MIDAS booking software and you select the "Use Strong Password Encryption for Authentication" option, then depending upon your installation of Perl, subsequent additional configuration may be required in order for MIDAS to utilize your MySQL server. Therefore, for maximum compatibility and to avoid any additional configuration, we advise selecting "Use Legacy Authentication Method".

Click "Next" and you'll then be prompted to set up a MySQL root password:

Set MySQL Root Password

This should be a secure password as it will be used to protect your MySQL server from unauthorized changes/access. You can also set up additional MySQL user accounts from this screen. If your MySQL server is to be used for multiple applications as well as MIDAS, it's strongly advisable to set up dedicated MySQL user accounts for each service which will be utilizing your MySQL server.

Click "Next" and you'll then be presented with options to configure MySQL to run as a Windows Service, so that it automatically runs whenever Windows starts:

Install MySQL as a Windows Service

Ensure the "Configure MySQL Server as a Windows Service" and "Start the MySQL Server at System Startup" options are selected and that the Windows Service is set to run as a "Standard System Account"

Clicking "Next" will then configure and start your MySQL server:

MySQL Windows Installation Complete


Step 3 - Verify and connect

With MySQL installed and configured, let's confirm the server is running and that you can connect to it.

Because you configured MySQL as a Windows service, it should already be running, and will start automatically whenever Windows starts. You can confirm this from a Command Prompt. (The MySQL 8.0 service is typically named "MySQL80", though the exact name can vary depending on the version installed, so check the Windows Services panel if unsure.)

net start MySQL80
If the service is already running, Windows will simply tell you so. You can also check, start, or stop it from the Windows "Services" panel (press WinKey + R and type "services.msc").

Next, connect to your server using the MySQL command-line client. The installer adds a "MySQL 8.0 Command Line Client" shortcut to your Start menu, or you can open a standard Command Prompt and enter:

mysql -u root -p
Enter the root password you set during installation when prompted.

Once connected, run a quick test to confirm the server version:

SELECT VERSION();
MySQL will report the version it's running, which confirms the server is installed and accepting connections. Type "exit" to leave the client.

By default, MySQL listens on port 3306, and its configuration file (my.ini) is located under "C:\ProgramData\MySQL\MySQL Server 8.0\". You won't normally need to change either of these for a standard MIDAS setup.


Troubleshooting

"client does not support authentication protocol requested by server; consider upgrading MySQL client", or other caching_sha2_password errors

This happens when MySQL is using the newer "Strong Password Encryption" (caching_sha2_password) authentication, but the connecting client (such as Perl) doesn't support it. For MIDAS, the simplest fix is to use the Legacy Authentication Method (see Step 2). If you've already installed using strong authentication, see our guide to fixing caching_sha2_password authentication errors.

The MySQL service won't start, or you see "Can't connect to MySQL server on 'localhost' (10061)"

The MySQL service isn't running. Start the "MySQL80" service from the Windows Services panel (services.msc), or run "net start MySQL80" from an administrative Command Prompt. If the service starts and then immediately stops, check the MySQL error log (a ".err" file) in the data directory for the cause.

"Access denied for user 'root'@'localhost'"

The root password being supplied doesn't match the one set during installation. Re-enter the correct password.

"'mysql' is not recognized as an internal or external command"

The MySQL "bin" folder isn't on your system PATH. Use the "MySQL 8.0 Command Line Client" shortcut in your Start menu, or add the bin folder (for example "C:\Program Files\MySQL\MySQL Server 8.0\bin") to your system PATH.


MySQL FAQs

Is MySQL free?

Yes. MySQL Community Server is free and open source.

MySQL or MariaDB, which should I use for MIDAS?

Either works. MIDAS supports both. If you'd prefer to use MariaDB, see our install MariaDB on Windows guide.

Which versions of Windows does MySQL support?

Current MySQL Community Server releases run on Windows 10, Windows 11, and Windows Server (2016 onwards).

Should I choose the web or full installer?

Both install the same software. The web installer is a smaller initial download and fetches components as needed; the full installer is larger but requires no further downloads during installation. Either is fine.

Legacy or strong authentication, which should I pick for MIDAS?

For maximum compatibility we recommend the Legacy Authentication Method, which avoids additional Perl configuration. See Step 2 for the full explanation.

How do I start or stop MySQL on Windows?

MySQL installs as a Windows service. Start or stop it with "net start MySQL80" or "net stop MySQL80" from an administrative Command Prompt, or from the Windows Services panel (services.msc).

What's the next step for MIDAS?

Once MySQL is installed, you'll need to create a database for MIDAS to use. See our guide on how to create a MySQL database.


Also In This Series...



Further Reading


← Return to the Knowledge Base