How to Install and Configure MySQL on a Windows Server

April 23, 2020

Introduction

MySQL is a well-established relational database management system. It is fully compatible with a Windows computer system. By using the MySQL Installer, an application designed to simplify the setup of MySQL products, MySQL can be installed and deployed within minutes.

The article is comprehensive, rich with images, and focuses on the individual steps needed to install and fully configure MySQL on a Windows server.

Guide on how top install and configure MySQL on Windows.

Prerequisites

  • Administrator privileges on Windows server
  • Windows computer system

Download MySQL Installer for Windows

The MySQL Installer for Windows helps you control the installation process by providing a user-friendly interface. It also guides you through the steps needed to configure MySQL.

Access your Windows server and download the MySQL Installer. A free Community edition MySQL Installer is available from the official page: https://dev.mysql.com/downloads/installer/

You are given the option to download either the Web Community version or the Full MySQL package.

  • The Web version (A) contains only the MySQL Installer and configuration files. You can customize and add additional MySQL products at a later point.
  • The Full version (B) contains all MySQL Windows products, including the MySQL Server.

Select and download your preferred version. In this example, we selected the Full MySQL Package (B).

Option to download full or web version of the MySQL Installer.

After selecting a version, you are provided with the option of signing up for a MySQL Community account. If you are not interested, select the No thanks, just start my download option at the bottom of the page.

Location of the link to download MySQL Installer.

By selecting this option, the download process starts immediately. Once the download is complete, you can execute the MySQL Installer file from the download folder.

It can take a few moments while Windows configures the MySQL Installer and prepares the installation and configuration process.

Set Up MySQL Installer for Windows

After accepting the Oracle license agreement terms, the first screen you encounter allows you to define which MySQL products are going to be installed. You can choose between several predefined options or create your custom setup type.

Note: Preconfigured setups can be customized later if necessary.

After accepting the Oracle license agreement terms, the first screen you encounter allows you to define which MySQL products are going to be installed. You can choose between several predefined options or create your custom setup type.

  • Developer Default installs all the tools you need to develop and micromanage your MySQL databases effectively.
  • Server Only is used to install an instance of the MySQL Server and forgo other MySQL products.
  • Client Only installs all products except the MySQL Server and associated tools.
  • The Full configuration installs all available MySQL products.

A Custom setup allows you to select the individual elements that are to be installed and alter predefined default settings.

In the example below, we select the Server Only option and click Next.

Dropdown allows you to select a MySQL installation configuration.

At this point, the system tries to resolve possible inconsistencies. It might inform you that additional packages need to be installed for the process to continue (e.g., Microsoft Visual C++ 2019 Redistributable Package). You can also run into Path installation inconsistencies if you have previous MySQL installations on your Windows Server.

Luckily the MySQL Installer auto-resolves issues and installs the latest binary compatible version of missing software. You are now ready to start the installation process in earnest. Click Execute to begin the installation process.

Location of Execute button to start the MySQL installation on Windows server.

Once the status of the installation status is labeled as Complete, you are ready to configure the MySQL database.

Configure MySQL Server on Windows

The MySQL Server 8.0.19 is now ready to be configured. Initiate the process by clicking Next.

Start the MySQL configuration process by clicking Next.

1. High Availability

The first configuration option affects database availability. It allows you to decide if you want to set up a Standalone MySQL Server or an InnoDB server cluster to improve availability. In this instance, we selected the classic, single server option.

High availablility allows you to choose between a Standalone Server or InnoDB cluster.

2. Type and Networking

The Type and Networking section is used to define several essential features.

The Config Type option lets you choose between three server configuration types. Development Computer, Server Computer, and Dedicated Computer define whether the server is dedicated solely to running your MySQL database or is going to share the underlying system with other applications.

In this example, we decided to create a dedicated MySQL server.

Define how much memory resources are being alocated to MySQL server.

The Type and Networking tab can also define the port the MySQL server is listening on. The default setting is port number 3306 and can be changed to suit your needs.

By checking the Show Advanced and Logging Option box, you can set additional logging options at a later stage.

Click Next once you’ve selected the options you feel meet your requirements.

Change port number or Show Advanced Options for MySQL configuration.

3. Authentication Method

It is possible to choose between two authentication methods, the recommended Strong Password Encryption, and the Legacy Authentication Method. Select the recommended Use Strong Password Authentication option.

Choose your prefered authentication method for your MySQL database server.

4. Accounts and Roles

You are now prompted to enter a password for your MySQL root user. You can also create additional roles for various users and purposes.

This is only an initial setup, and credentials can be edited once the installation is complete.

Define user accounts and roles for MySQL Server.

5. Windows Service

By defining MySQL as a Windows Service, it can now start automatically whenever the Windows system boots.

If you decide to start MySQL as an executable application, you would need to configure it manually.

How to define MySQL as a Windows Service.

6. Logging Options (Optional)

If you have selected the Show Advanced Logging option in the Type and Networking tab, you are now able to set up MySQL log preferences.

Logging options let you select the types of logs you want to activate and define the log directories.

Customize MySQL log directories.

Click Next to reach the Advanced Options section.

7. Advanced Options (Optional)

Advanced Options include setting a unique server identifier, and the type of case (Lower/Upper) to be used for Table Names.

These settings are only available if you have checked the Show Advanced Options box in the Type and Networking tab.

8. Apply Configuration

You have successfully configured the MySQL server and need to confirm for the MySQL Installer to apply the configuration.

An overview of the configurations steps appears on the screen. Click Execute to apply the configuration.

Click Execute to apply the settings from the previuos steps.

The system informs once the configuration process is completed. Select Next to continue the installation process.

The configuration process is complete, click Next to continue the installation.

Complete MySQL Installation on Windows Server

After clicking Next, you are given the option to copy the installation process log to the Windows Clipboard.

Copy log of installation process on Clipboard and finish MySQL installation on Windows.

Click Finish to complete the MySQL server installation on Windows.

Start MySQL Server on Windows

If you need to start the MySQL Server on Windows for the first time enter the following command in the Windows Command Prompt:

"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld" --console

The path in this command is the default installation folder. In case you have installed MySQL in a different folder, the command needs to reflect that to launch the mysqld executable file successfully.

The --console option displays output directly on your console. Omitting this option sends the output directly to the MySQL logs.

Stop MySQL Server on Windows

To shut down MySQL Server in Windows, type the following command in the Windows Command Prompt:

"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqladmin" -u root shutdown

The mysqladmin tool performs the shutdown command and fully stops the MySQL server. The system does not provide output as confirmation.

Conclusion

Installing MySQL on a Windows server is simple when using the MySQL Installer tool. The configuration process has many available options that are significantly easier to navigate by following the stages outlined in this article.

The same methods can be used to install various MySQL products as well as alter existing configurations at a later point. One of those products is Microsofts SQL Server Express, a free version of Microsoft’s SQL Server. Check out our article on how to install SQL Server Express to learn more about this product.

Was this article helpful?
YesNo
Vladimir Kaplarevic
Vladimir is a resident Tech Writer at phoenixNAP. He has more than 7 years of experience in implementing e-commerce and online payment solutions with various global IT services providers. His articles aim to instill a passion for innovative technologies in others by providing practical advice and using an engaging writing style.
Next you should read
How to Create MySQL Database in Workbench
January 29, 2020

Workbench is a cross-platform, open-source, visual tool for database management. It provides a user-friendly...
Read more
How to Improve MySQL Performance With Tuning
April 25, 2024

The performance of MySQL databases is an essential factor in the optimal operation of your server. Make sure...
Read more
How To Create New MySQL User and Grant Privileges
July 18, 2024

MySQL is a database application for Linux. It's part of the LAMP (Linux, Apache, MySQL, PHP) stack that...
Read more
How to Connect to MySQL from Windows Command Line
April 23, 2020

MySQL is a popular and open-source relational database application. Many servers make use of MySQL, to...
Read more