#1 India's Top IT Training Institute
×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
Mentors

Mentors

Meet the industry experts who train and guide you through your course.

Read More →
Free Resources

Free Resources

Free tutorials, interview questions, tools and calculators to help you learn.

Explore →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
MySQL Tutorial · Data Analytics

How to Install MySQL on Windows: Step-by-Step Guide

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

  1. Open the MySQL Community Downloads page and choose MySQL Community Server.
  2. Select the LTS version and Microsoft Windows, then download the MSI Installer (64-bit). The ZIP archive is for manual setups (see Step 6).
  3. You can skip the Oracle account sign-in with the "No thanks, just start my download" link.
  4. 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

ScreenSensible choice for a learning machine
Data directoryKeep the default under C:\ProgramData\MySQL\ (a hidden folder)
Config typeDevelopment Computer: uses little memory
Port3306, unless something else already uses it
Open Windows firewall portLeave it unticked if only this PC will connect
Root passwordA strong password you will remember; write it down somewhere safe
Extra user accountsOptional; you can create them with SQL later (Step 5)
Windows serviceRun as a service, with a name such as MySQL84; choose whether it starts at boot
Sample databasesOptional; 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;
idnote
1MySQL is working
2Second 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

ProblemCheck
'mysql' is not recognized as an internal or external commandThe PATH entry is missing or wrong, or the terminal was opened before you changed PATH. Open a new one.
Port 3306 already in useRun 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 startOpen 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 serverThe 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.

Become a Job-Ready Data Analyst

Master MySQL, Advanced Excel, Power BI, Tableau and Python with Uncodemy's Data Analytics Training in Noida — live projects, expert mentors and Dedicated Placement Support.

Enroll in Data Analytics Course →