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:
| File | Size | Best For |
|---|---|---|
mysql-installer-community-x.x.x.x.msi | ~300-500 MB | Most users — full offline installer |
mysql-installer-web-community-x.x.x.x.msi | ~20 MB | Fast 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:
| Type | What It Installs | Recommendation |
|---|---|---|
| Server only | MySQL Server | Best for learning JDBC — minimal footprint |
| Client only | Command-line tools, no server | Skip this — you need the server |
| Full | Server, Workbench, Router, Shell | Useful but takes more space |
| Custom | You pick individual products | Advanced 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:
| Setting | Recommended Value |
|---|---|
| Config Type | Development Computer |
| Connectivity | TCP/IP checked, Port 3306 |
| X Protocol | Leave enabled (does not interfere) |
| Named Pipe / Shared Memory | Optional — 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.
| Setting | Recommended Value |
|---|---|
| Configure MySQL Server as a Windows Service | Checked |
| Windows Service Name | MySQL80 (default) |
| Start the MySQL Server at System Startup | Checked |
| Run Windows Service as | Standard 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.
- Open the Start menu and search for Environment Variables.
- Click Edit the system environment variables.
- In the System Properties window, click Environment Variables.
- Under System variables, find
Pathand click Edit. - Click New and add the path to your MySQL
binfolder:
C:\Program Files\MySQL\MySQL Server 8.0\bin- 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:
# Check the MySQL client version
mysql --versionYou should see output similar to:
mysql Ver 8.0.36 for Win64 on x86_64 (MySQL Community Server - GPL)Now connect to the server:
# Log in as root
mysql -u root -pEnter 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:
-- 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:
mysql -u root -pThen run:
Test the new user login:
# Log in as the tutorial user
mysql -u jdbc_user -pEnter 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:
- Press
Win + R, typeservices.msc, and press Enter. - Find MySQL80 in the list.
- Right-click and choose Start, Stop, or Restart.
Via Command Prompt (Administrator):
# Stop the MySQL service
net stop MySQL80
# Start the MySQL service
net start MySQL80FAQ
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?
- Open the MySQL Installer again and choose Remove.
- Select all installed products and click Execute.
- After removal, manually delete
C:\ProgramData\MySQL(hidden folder) andC:\Program Files\MySQLif they remain. - 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.