Installing MySQL on Windows

Introduction

To practice SQL locally, install the MySQL Server on Windows using the official MySQL Installer. This chapter downloads the MSI, configures root password and port 3306, registers a Windows service, and verifies login—matching what production-style Java and Node apps expect.

Prerequisites

  • What Is MySQL
  • Windows 10 or 11 with administrator rights
  • ~500 MB disk space

Download MySQL Installer

  1. Open MySQL Community Downloads — Installer
  2. Download the full offline MSI (larger file, ~300–500 MB)—more reliable on slow networks than the web installer
InstallerWhen to use
Full MSIRecommended for tutorials
Web MSISmall download; fetches components online

Run the MSI; accept UAC if prompted.

Setup Type

TypeInstallsChoice
Server onlyMySQL ServerRecommended for this track
FullServer + Workbench + extrasOK if you want GUI immediately
CustomPick componentsAdvanced

Select Server onlyNextExecute to install.

Server Configuration

High availability

Choose Standalone MySQL Server / Classic MySQL Replication.

Type and networking

SettingValue
Config TypeDevelopment Computer
Port3306 (default)
TCP/IPEnabled

Authentication

Keep Use Strong Password Encryption (caching_sha2_password) for MySQL 8 with modern clients.

Set a strong root password—you will use it often.

Warning

Remember the Root Password

Resetting forgotten root on Windows is tedious—store in a password manager.

Windows service

SettingValue
Run as Windows ServiceYes
Service nameMySQL80 (default)
Start at bootYes for convenience

Finish configuration; installer may open MySQL Workbench—optional.

Add mysql to PATH (Optional)

Default client path:

text
C:\Program Files\MySQL\MySQL Server 8.0\bin

Add to System Environment Variables → Path so PowerShell finds mysql:

powershell
mysql --version

Restart terminal after PATH change.

Verify Installation

Check service:

powershell
Get-Service MySQL80

Status should be Running.

Login:

powershell
mysql -u root -p

Enter root password. Prompt changes to:

text
mysql>

Run:

sql
SELECT VERSION();
SHOW DATABASES;

Exit:

sql
EXIT;

Code explanation:

  • -u root — user root
  • -p — prompt for password (no space before password on same flag in scripts)

Common Windows Issues

ProblemFix
mysql not recognizedAdd bin to PATH or use full path
Port 3306 in useChange port in installer or stop conflicting app
Service will not startCheck Event Viewer; reinstall if corrupt
Access deniedWrong password; retry or reset root

See also JDBC Windows install for driver-focused notes.

FAQ

MySQL vs XAMPP MySQL?

XAMPP bundles MariaDB/MySQL for PHP stacks—pick one server to avoid port conflicts.

Workbench not installed?

Re-run installer → Add MySQL Workbench via Custom/Full, or use DBeaver.

WSL2 Linux MySQL instead?

Valid alternative—see Installing MySQL on Linux inside WSL.

Uninstall cleanly?

Windows Apps & features → MySQL Server → Uninstall; remove data folder if reinstalling fresh.

Firewall?

Local localhost needs no rule; remote access requires opening 3306—avoid for dev.

Which MySQL 8 minor version?

Latest 8.0.x from installer is fine.