Decide two things before you download anything: which MySQL version you want, and whether you also want a graphical tool. For learning SQL or building a college project, a current long-term support (LTS) release of MySQL Community Server plus MySQL Workbench is a sensible default. Both are free from the official site, dev.mysql.com/downloads. Avoid third-party "MySQL setup" downloads.
One recent change affects older tutorials. The all-in-one "MySQL Installer for Windows" covered the 8.0 series, and 8.0 has reached the end of its support life. For 8.4 LTS and later, the server comes as its own MSI package, which finishes by launching MySQL Configurator, and Workbench is downloaded separately. The settings you choose are the same either way. The screens below follow the MSI + Configurator flow, so labels may differ slightly between releases.
Step 1: download the right files
- Open the MySQL Community Downloads page and choose MySQL Community Server.
- Select the LTS version and Microsoft Windows, then download the MSI Installer (64-bit). The ZIP archive is for manual setups (see Step 6).
- You can skip the Oracle account sign-in with the "No thanks, just start my download" link.
- Download MySQL Workbench for Windows as well, if you want a GUI.
You need a 64-bit Windows 10 or 11 machine and administrator rights. If setup complains about a missing Visual C++ runtime, install the current Microsoft Visual C++ Redistributable (x64) and run setup again.
Step 2: run the server MSI
Choose the Typical setup unless you need a custom path. Files go under C:\Program Files\MySQL\MySQL Server <version>\. When the MSI finishes, leave "Run MySQL Configurator" ticked.
Step 3: configure the server
| Screen | Sensible choice for a learning machine |
|---|---|
| Data directory | Keep the default under C:\ProgramData\MySQL\ (a hidden folder) |
| Config type | Development Computer: uses little memory |
| Port | 3306, unless something else already uses it |
| Open Windows firewall port | Leave it unticked if only this PC will connect |
| Root password | A strong password you will remember; write it down somewhere safe |
| Extra user accounts | Optional; you can create them with SQL later (Step 5) |
| Windows service | Run as a service, with a name such as MySQL84; choose whether it starts at boot |
| Sample databases | Optional; handy for practice |
Click Execute. Each step should get a green tick. If one fails, the log pane shows why, and the most common causes are in the troubleshooting table below.
Step 4: make mysql work from any terminal
Add the server's bin folder to your PATH. Open Edit the system environment variables → Environment Variables, select Path, click New and add, for example, C:\Program Files\MySQL\MySQL Server 8.4\bin (use your installed version). Open a new terminal and connect:
mysql -u root -p
Enter the root password. You should see a mysql> prompt. Check what you are running:
SELECT VERSION();
SHOW VARIABLES WHERE Variable_name IN
('port','character_set_server','default_storage_engine','lower_case_table_names');
On a default Windows setup, expect utf8mb4, InnoDB, your chosen port, and lower_case_table_names = 1. That last value means Windows stores table names in lowercase and compares them case-insensitively. Linux servers default to 0 (case-sensitive), so name tables in lowercase from day one if your project will ever run on Linux.
Step 5: prove it works, then stop using root
CREATE DATABASE practice_db;
USE practice_db;
CREATE TABLE first_test (
id INT AUTO_INCREMENT PRIMARY KEY,
note VARCHAR(40),
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO first_test (note) VALUES ('MySQL is working'), ('Second row');
SELECT id, note FROM first_test;
| id | note |
|---|---|
| 1 | MySQL is working |
| 2 | Second row |
For daily work and for your application's connection string, create a normal user limited to your project database:
CREATE USER 'student'@'localhost' IDENTIFIED BY 'Pick-A-Strong-One1';
GRANT ALL PRIVILEGES ON practice_db.* TO 'student'@'localhost';
SHOW GRANTS FOR 'student'@'localhost';
| Grants for student@localhost |
|---|
| GRANT USAGE ON *.* TO `student`@`localhost` |
| GRANT ALL PRIVILEGES ON `practice_db`.* TO `student`@`localhost` |
Next steps are in creating a database and creating tables. To work visually, install Workbench and add a connection to localhost:3306; the MySQL Workbench tutorial covers the interface.
Step 6 (optional): the ZIP archive route
If you cannot run an installer, for example on a locked-down lab PC, extract the ZIP, open a terminal in its bin folder and run:
mysqld --initialize --console
mysqld --console
The first command creates the data directory and prints a temporary root password in its output; copy it. The second starts the server in that window. Connect from another terminal and change the password with ALTER USER 'root'@'localhost' IDENTIFIED BY 'new-password';. To run it as a service, use mysqld --install from an administrator terminal.
Troubleshooting
| Problem | Check |
|---|---|
'mysql' is not recognized as an internal or external command | The PATH entry is missing or wrong, or the terminal was opened before you changed PATH. Open a new one. |
| Port 3306 already in use | Run netstat -ano | findstr :3306 to find the process ID. An older MySQL, MariaDB or XAMPP install is the usual cause. Stop it, or choose another port such as 3307. |
| Service will not start | Open the .err file in the data directory under C:\ProgramData\MySQL\. Typical causes are a data folder left over from an earlier install, or a mistake in my.ini. |
ERROR 2003: Can't connect to MySQL server | The service is stopped. Start it from services.msc, or run net start MySQL84 (your service name) as administrator. |
ERROR 1045: Access denied for user 'root'@'localhost' | Wrong password, or you forgot -p. If the password is truly lost, see resetting the root password. |
More error messages and their fixes are collected in common MySQL errors. Installing on Linux instead? See installing MySQL on Ubuntu.