Skip to content
Runbook

Install MySQL on Windows

Popular open source SQL relational database.

Databasesqlrdbmsrelationaldatabaseacid

Installation

Installer (winget) · winget
winget install -e --id Oracle.MySQL

Installs MySQL Server and the command-line client, and registers a Windows service.

Verify the installation

Verify
mysql --version

Service

Start
net start MySQL80
Stop
net stop MySQL80
Status
sc query MySQL80
Restart
net stop MySQL80 && net start MySQL80

Important files

TypePathDescription
configC:\ProgramData\MySQL\MySQL Server 8.0\my.iniMain configuration file.
dataC:\ProgramData\MySQL\MySQL Server 8.0\DataData directory.
binaryC:\Program Files\MySQL\MySQL Server 8.0\binExecutables (mysql, mysqld...) to add to the PATH.

Default ports

3306

Command-line tools

  • mysqlInteractive SQL client.
  • mysqldThe server daemon.
  • mysqladminAdministrative client.

Uninstall

Uninstall
winget uninstall -e --id Oracle.MySQL

The data directory under C:\ProgramData\MySQL may remain; delete it manually to wipe everything.

Good to know

  • The Windows service name depends on the major version: MySQL80 for 8.0. Verify with sc query.
  • The MySQL Installer sets the root password during setup; keep it safe.
  • Add the bin folder to the PATH if mysql is not recognized in the terminal.

Installation on Windows

winget install -e --id Oracle.MySQL runs the MySQL Installer, which installs the server and command-line client and registers a Windows service. The interactive setup asks for a root password — write it down.

Windows service and service name

MySQL runs as a service named after the major version, typically MySQL80. The net start / net stop and sc query commands above use that name; adjust it if your version differs (check with sc query).

Adding mysql to the PATH

The executables are in C:\Program Files\MySQL\MySQL Server 8.0\bin. If mysql is not recognized, add that folder to the Path environment variable, then open a new terminal.