Installing MySQL on Windows

This chapter walks you through installing MySQL 8 directly on Windows using the official MySQL Installer. We will cover every step from download to verification, including common pitfalls like PATH configuration and authentication plugin choices.

Prerequisites

  • Windows 10 or Windows 11
  • Administrator privileges
  • Approximately 500 MB of free disk space

Downloading the Installer

Visit the MySQL Community Downloads page and download the Windows (x86, 32-bit), MSI Installer marked as the larger file size (this is the full offline installer). The smaller "web-community" version works too, but it downloads components during installation, which can fail on slow or restricted networks.

If you see two options:

FileSizeBest For
mysql-installer-community-x.x.x.x.msi~300-500 MBMost users — full offline installer
mysql-installer-web-community-x.x.x.x.msi~20 MBFast internet, latest components always

Save the MSI to your Downloads folder and run it. Windows may show a security warning — click Run or More info → Run anyway.

Choosing a Setup Type

The installer presents several setup types:

TypeWhat It InstallsRecommendation
Server onlyMySQL ServerBest for learning JDBC — minimal footprint
Client onlyCommand-line tools, no serverSkip this — you need the server
FullServer, Workbench, Router, ShellUseful but takes more space
CustomYou pick individual productsAdvanced users only

Select Server only and click Next. You can always add Workbench later through the same installer.

Installation Progress

The installer checks for required Windows components (like Visual C++ redistributables) and installs them automatically if they are missing. This may take a few minutes.

Click Execute when prompted to install the selected products, then Next to proceed to configuration.

Configuring the Server

Group Replication and Standalone

On the High Availability screen, choose Standalone MySQL Server / Classic MySQL Replication. Group replication is for clustered production environments and is not needed for local development.

Type and Networking

On the Type and Networking screen:

SettingRecommended Value
Config TypeDevelopment Computer
ConnectivityTCP/IP checked, Port 3306
X ProtocolLeave enabled (does not interfere)
Named Pipe / Shared MemoryOptional — leave unchecked unless you know you need them

The Development Computer option allocates moderate memory for MySQL, leaving plenty for your IDE and browser. Server Computer would reserve more RAM, which is unnecessary on a development machine.

Authentication Method

This is a critical screen. MySQL 8 introduced a new default authentication plugin called caching_sha2_password, which is more secure than the legacy mysql_native_password. However, some older JDBC drivers and clients have trouble with it.

For this tutorial:

  • Choose Use Strong Password Encryption for Authentication (the default) if you are using MySQL Connector/J 8.0.9 or later, which fully supports it.
  • Choose Use Legacy Authentication Method only if you are forced to use an extremely old driver.

Since we are using the latest mysql-connector-j, keep the strong password option selected.

Accounts and Roles

Set the root password. This is the master password for your MySQL instance. Choose something you will remember — you will type it frequently during development.

Optionally, click Add User to create an additional account. For this tutorial, the root account is sufficient.

Warning

Do Not Forget the Root Password

Resetting a forgotten MySQL root password on Windows is possible but tedious. Write it down in a password manager.

Windows Service

MySQL installs itself as a Windows service so it starts automatically when you boot your computer.

SettingRecommended Value
Configure MySQL Server as a Windows ServiceChecked
Windows Service NameMySQL80 (default)
Start the MySQL Server at System StartupChecked
Run Windows Service asStandard System Account

Click Execute to apply the configuration. The installer starts the MySQL service and verifies it is running. When all checkmarks turn green, click Finish.

Adding MySQL to PATH

By default, the MySQL installer does not add the mysql command-line client to your system PATH. You need to do this manually to run mysql from any Command Prompt or PowerShell window.

  1. Open the Start menu and search for Environment Variables.
  2. Click Edit the system environment variables.
  3. In the System Properties window, click Environment Variables.
  4. Under System variables, find Path and click Edit.
  5. Click New and add the path to your MySQL bin folder:
text
C:\Program Files\MySQL\MySQL Server 8.0\bin
  1. Click OK three times to save.

Tip

Verify the Exact Path

If you installed MySQL to a non-default location, adjust the path accordingly. You can find the correct folder by opening C:\Program Files\MySQL\ and looking for the versioned folder.

Verifying the Installation

Open a new Command Prompt or PowerShell window (required for PATH changes to take effect) and run:

bash
# Check the MySQL client version
mysql --version

You should see output similar to:

text
mysql  Ver 8.0.36 for Win64 on x86_64 (MySQL Community Server - GPL)

Now connect to the server:

bash
# Log in as root
mysql -u root -p

Enter the root password you set during installation. If you see the mysql> prompt, the server is running and accepting connections.

Run a quick sanity check:

sql
-- Show the server status
STATUS;
 
-- List existing databases
SHOW DATABASES;
 
-- Exit the client
EXIT;

Creating the Tutorial Database

Now that MySQL is running, create the jdbc_demo database and a dedicated user for this tutorial. Open Command Prompt and log in:

bash
mysql -u root -p

Then run:

Test the new user login:

bash
# Log in as the tutorial user
mysql -u jdbc_user -p

Enter jdbcpass. If you see the mysql> prompt, everything is configured correctly.

Starting and Stopping the Service

MySQL runs as a Windows service, so you can control it through the Services panel or the command line.

Via Services panel:

  1. Press Win + R, type services.msc, and press Enter.
  2. Find MySQL80 in the list.
  3. Right-click and choose Start, Stop, or Restart.

Via Command Prompt (Administrator):

bash
# Stop the MySQL service
net stop MySQL80
 
# Start the MySQL service
net start MySQL80

FAQ

The installer says "Missing Visual C++ Redistributable" and fails.

Download the latest Visual C++ Redistributable from Microsoft's website and install it. The MySQL installer tries to do this automatically, but sometimes fails on heavily restricted machines.

I get "mysql is not recognized" even after adding it to PATH.

You must open a new terminal window after editing PATH. Existing Command Prompt windows do not pick up the change. Also double-check that the path points to the bin folder, not the parent MySQL folder.

Can I install MySQL on a drive other than C:?

Yes. On the Installation screen of the MySQL Installer, click Advanced Options next to the product and change the installation path. Make sure to update your PATH environment variable to match the new location.

How do I completely uninstall MySQL?

  1. Open the MySQL Installer again and choose Remove.
  2. Select all installed products and click Execute.
  3. After removal, manually delete C:\ProgramData\MySQL (hidden folder) and C:\Program Files\MySQL if they remain.
  4. Remove the MySQL data directory if you created one outside the default location.

Can I have multiple MySQL versions installed?

Technically yes, but it is not recommended for beginners. Each version would need a different service name, port, and data directory. If you need to test against multiple MySQL versions, Docker is a much cleaner solution.