Welcome to the MySQL Workbench Setup and Installation Guide by HitaVir Tech!

This codelab walks you through installing MySQL Server and MySQL Workbench on Windows from scratch. By the end, you will have a fully working database environment and will have run your first SQL queries.

What is MySQL?

MySQL is the world's most popular open-source relational database. It stores data in organized tables — rows and columns — just like a spreadsheet, but much more powerful.

Real-world analogy: Think of MySQL as a giant, super-fast filing cabinet. Each drawer (database) contains folders (tables), and each folder has organized records (rows).

What is MySQL Workbench?

MySQL Workbench is the official graphical tool for MySQL. It lets you:

Real-world analogy: If MySQL Server is the engine of a car, MySQL Workbench is the dashboard — it gives you a visual way to control everything.

What You Will Do in This Lab

Step

Task

1

Download the MySQL Installer

2

Install MySQL Server

3

Configure MySQL Server (set root password)

4

Install MySQL Workbench

5

Connect to MySQL using Workbench

6

Run your first SQL queries

7

Import a database (.sql file)

Why MySQL for Data Engineering?

HitaVir Tech says: "SQL is the language of data. No matter what tools you use — Python, Spark, Airflow, Databricks — they all talk to databases using SQL. Learning MySQL is learning the foundation of data engineering."

Required

No Prior Knowledge Needed

This guide assumes zero experience with databases or SQL. We start from downloading the installer.

What You Will Need Later

HitaVir Tech says: "The most common mistake students make is forgetting their root password during setup. Write it down on paper or save it in a password manager BEFORE you proceed. You will need it every time you open MySQL Workbench."

Let us download the official MySQL Installer from Oracle's website.

Step 1 — Open the MySQL Downloads Page

Open your browser and go to:

https://dev.mysql.com/downloads/installer/

Step 2 — Select the Full Installer

You will see two download options:

Installer

Size

What It Contains

Web installer (smaller)

~2 MB

Downloads components during installation

Full installer (larger)

~450 MB

Contains everything offline

Choose the larger installer (approximately 450 MB) — it includes everything and does not require internet during installation.

Step 3 — Download Without Login

After clicking Download, MySQL may ask you to log in or sign up. You do NOT need an account.

Click "No thanks, just start my download" at the bottom of the page.

Step 4 — Wait for Download to Complete

The file will be named something like:

mysql-installer-community-8.0.xx.msi

Save it to your Downloads folder.

Verify the Download

Make sure the file size is approximately 400-500 MB. If it is only a few MB, you downloaded the web installer by mistake — go back and select the larger one.

HitaVir Tech says: "Always download from the official MySQL website (dev.mysql.com). Never use third-party download sites — they may contain modified or outdated software."

Now let us install MySQL Server, Workbench, and Shell together using the MySQL Installer.

Step 1 — Run the Installer

  1. Open your Downloads folder
  2. Double-click the file: mysql-installer-community-8.0.xx.msi
  3. If Windows asks for permission (User Account Control), click Yes

Step 2 — Choose Setup Type

The installer opens with a "Choosing a Setup Type" screen. You will see these options:

Setup Type

What It Installs

Developer Default

MySQL Server + Workbench + Shell + Connectors (Recommended)

Server only

Just the MySQL Server

Client only

Client tools without the server

Full

Everything MySQL offers

Custom

Pick exactly what you want

Select "Developer Default" and click Next.

This installs:

Step 3 — Check Requirements

The installer may show missing requirements (like Visual C++ Redistributable). Click Execute to install them automatically, then click Next.

Step 4 — Installation

Click Execute to begin downloading and installing all selected products.

You will see a progress screen:

Product                    Status      Progress
MySQL Server 8.0.xx        Complete    ████████████ 100%
MySQL Workbench 8.0.xx     Complete    ████████████ 100%
MySQL Shell 8.0.xx         Complete    ████████████ 100%

Wait until all products show Complete, then click Next.

Using Custom Installation (Alternative)

If you chose Custom instead of Developer Default:

  1. In the left panel, expand MySQL Servers and select the latest version
  2. Click the right arrow to move it to "Products To Be Installed"
  3. Expand Applications and add:
    • MySQL Workbench
    • MySQL Shell
  4. Click Next then Execute

HitaVir Tech says: "Developer Default is the best choice for learners. It installs everything you need in one click. You can always add or remove components later using the MySQL Installer."

After installation, the installer moves to configuration. This is where you set up your database server.

Step 1 — Type and Networking

The first configuration screen shows Type and Networking settings:

Setting

Value

Notes

Config Type

Development Computer

Uses minimal resources

TCP/IP

Checked

Enables network connections

Port

3306

Default MySQL port

X Protocol Port

33060

For MySQL Shell X Protocol

Open Windows Firewall

Checked

Allows connections through firewall

Keep all defaults and click Next.

Step 2 — Authentication Method

Select "Use Strong Password Encryption for Authentication (RECOMMENDED)"

This uses the modern caching_sha2_password authentication. Click Next.

Step 3 — Accounts and Roles (CRITICAL)

This is where you set the root password. The root account has full access to everything.

Set your MySQL Root Password:

Field

What to Enter

MySQL Root Password

Your chosen password

Repeat Password

Same password again

Password rules:

WRITE DOWN THIS PASSWORD. You will need it every time you connect to MySQL.

You can also add additional user accounts here, but for learning, the root account is sufficient.

Click Next.

Step 4 — Windows Service

Setting

Value

Configure MySQL Server as a Windows Service

Checked

Windows Service Name

MySQL80

Start the MySQL Server at System Startup

Checked

Run Windows Service as

Standard System Account

Keep all defaults and click Next.

This means MySQL will start automatically whenever you turn on your computer.

Step 5 — Apply Configuration

Click Execute to apply all configuration settings.

You will see checkmarks appear:

Writing configuration file             ✓
Updating Windows Firewall rules        ✓
Adjusting Windows service              ✓
Initializing database (may take time)  ✓
Starting the server                    ✓
Applying security settings             ✓
Updating the Start menu link           ✓

Once all steps show checkmarks, click Finish.

Step 6 — Complete the Installer

Click Next through any remaining screens, then Finish.

Check both boxes if offered:

HitaVir Tech says: "Port 3306 is MySQL's home address. Just like your house has a street address, every network service has a port number. If something else is using port 3306, the installation will warn you — we will cover that in troubleshooting."

MySQL Workbench should open automatically after installation. If not, search for "MySQL Workbench" in the Windows Start menu.

Step 1 — Open MySQL Workbench

You will see the Welcome screen with:

Step 2 — Click the Local Instance

Click on Local instance MySQL80 (the grey tile showing root and localhost:3306).

Step 3 — Enter Your Password

A dialog box appears:

Connect to MySQL Server
Service: MySQL@localhost:3306
User: root
Password: [enter your root password here]

Enter the root password you set during installation.

Check "Save password in vault" if you do not want to type it every time.

Click OK.

Step 4 — You Are Connected!

You should now see the MySQL Workbench main interface with:

Verify the Connection

In the query editor, type:

SELECT VERSION();

Click the lightning bolt icon (or press Ctrl + Enter) to run the query.

Expected output:

+-----------+
| VERSION() |
+-----------+
| 8.0.xx    |
+-----------+

If you see a version number, your MySQL is working perfectly!

HitaVir Tech says: "Seeing the version number is your ‘Hello World' moment for databases. It confirms that the server is running, the connection works, and you are ready to write SQL."

Let us write real SQL queries to create a database, tables, and insert data.

Query 1 — Show All Databases

SHOW DATABASES;

Click the lightning bolt to execute. Expected output:

+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+

These are built-in system databases. You will add your own next.

Query 2 — Create Your First Database

CREATE DATABASE hitavir_db;

Expected output:

1 row(s) affected

Query 3 — Verify It Was Created

SHOW DATABASES;

You should now see hitavir_db in the list!

Query 4 — Use Your Database

USE hitavir_db;

This tells MySQL: "I want to work with the hitavir_db database now."

Query 5 — Create a Table

CREATE TABLE students (
    student_id INT AUTO_INCREMENT PRIMARY KEY,
    first_name VARCHAR(50) NOT NULL,
    last_name VARCHAR(50) NOT NULL,
    email VARCHAR(100),
    batch INT DEFAULT 5,
    enrollment_date DATE DEFAULT (CURRENT_DATE)
);

Expected output:

0 row(s) affected

Query 6 — Insert Data

INSERT INTO students (first_name, last_name, email, batch) VALUES
('Priya', 'Sharma', 'priya@hitavir.tech', 5),
('Rahul', 'Patil', 'rahul@hitavir.tech', 5),
('Sneha', 'Kulkarni', 'sneha@hitavir.tech', 5),
('Amit', 'Joshi', 'amit@hitavir.tech', 4),
('Kavya', 'Reddy', 'kavya@hitavir.tech', 4);

Expected output:

5 row(s) affected

Query 7 — Read Your Data

SELECT * FROM students;

Expected output:

+------------+------------+-----------+--------------------+-------+-----------------+
| student_id | first_name | last_name | email              | batch | enrollment_date |
+------------+------------+-----------+--------------------+-------+-----------------+
|          1 | Priya      | Sharma    | priya@hitavir.tech |     5 | 2026-04-06      |
|          2 | Rahul      | Patil     | rahul@hitavir.tech |     5 | 2026-04-06      |
|          3 | Sneha      | Kulkarni  | sneha@hitavir.tech |     5 | 2026-04-06      |
|          4 | Amit       | Joshi     | amit@hitavir.tech  |     4 | 2026-04-06      |
|          5 | Kavya      | Reddy     | kavya@hitavir.tech |     4 | 2026-04-06      |
+------------+------------+-----------+--------------------+-------+-----------------+

Query 8 — Filter Data

SELECT first_name, last_name, email
FROM students
WHERE batch = 5;

Query 9 — Count Records

SELECT batch, COUNT(*) AS total_students
FROM students
GROUP BY batch;

Expected output:

+-------+----------------+
| batch | total_students |
+-------+----------------+
|     4 |              2 |
|     5 |              3 |
+-------+----------------+

Query 10 — Update Data

UPDATE students
SET email = 'priya.sharma@hitavir.tech'
WHERE student_id = 1;

Quick SQL Reference

Command

Purpose

Example

SHOW DATABASES;

List all databases

CREATE DATABASE

Create new database

CREATE DATABASE mydb;

USE

Switch to a database

USE mydb;

CREATE TABLE

Create a new table

See above

INSERT INTO

Add rows to a table

See above

SELECT

Read data

SELECT * FROM table;

UPDATE

Modify existing data

UPDATE table SET col=val;

DELETE

Remove rows

DELETE FROM table WHERE id=1;

DROP TABLE

Delete a table

DROP TABLE students;

DROP DATABASE

Delete a database

DROP DATABASE mydb;

HitaVir Tech says: "You just created a database, built a table, inserted data, and queried it — all in 10 minutes. This is exactly what data engineers do every day. The SQL you just wrote is the same SQL used at Google, Amazon, and Netflix."

In real projects, you often need to import existing databases from .sql files. Let us learn how.

Step 1 — Create a Schema for Import

In MySQL Workbench, click the "Create a new schema" icon (cylinder icon in the toolbar).

  1. Enter the schema name: farmers_market
  2. Click Apply
  3. In the popup, click Apply again
  4. Click Finish

You should see farmers_market appear in the left panel under SCHEMAS.

Step 2 — Open Data Import

Go to the menu bar:

Server → Data Import

A new tab called "Administration - Data Import / Restore" opens.

Step 3 — Configure Import Settings

In the Import from Disk tab:

Setting

Value

Import from

Self-Contained File (select this radio button)

File path

Browse to your downloaded .sql file

Default Target Schema

Select farmers_market from the dropdown

At the bottom right, select: Dump Structure and Data

Step 4 — Start the Import

  1. Click the Import Progress tab
  2. Click Start Import
  3. Wait for the import to complete

Expected output:

Import Completed
Status: 1 of 1 imported

Step 5 — Refresh and Verify

  1. In the left panel, right-click on farmers_market
  2. Select Refresh All
  3. Expand farmers_marketTables

You should see the imported tables listed.

Step 6 — Query the Imported Data

USE farmers_market;
SHOW TABLES;

Try querying a table:

SELECT * FROM customer_purchases LIMIT 10;

HitaVir Tech says: "Importing .sql files is how teams share databases. When you join a company, the first thing you will do is import the team's database into your local Workbench for development and testing."

Here are the most common problems and their fixes.

MySQL Service Not Starting

Symptom: MySQL Workbench cannot connect, error "Can't connect to MySQL server"

Fix:

  1. Press Win + R, type services.msc, press Enter
  2. Find MySQL80 in the list
  3. Check if the status is Running
  4. If stopped, right-click and select Start

Or from Command Prompt (run as Administrator):

net start MySQL80

Port 3306 Already in Use

Symptom: Installation warns that port 3306 is occupied

Fix:

Check what is using the port:

netstat -ano | findstr :3306

If another MySQL instance is running, stop it first. Or use a different port (e.g., 3307) during configuration.

Forgot Root Password

Symptom: Cannot connect to MySQL, password rejected

Fix (Windows):

  1. Stop MySQL service: net stop MySQL80
  2. Open Command Prompt as Administrator
  3. Start MySQL in safe mode:
mysqld --skip-grant-tables --shared-memory
  1. Open another Command Prompt:
mysql -u root
  1. Reset the password:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword123!';
FLUSH PRIVILEGES;
  1. Restart MySQL normally: net start MySQL80

Workbench Connection Failed

Symptom: "Cannot Connect to Database Server" error

Checklist:

Check

How

Is MySQL service running?

Check services.msc

Correct password?

Try the password you set during install

Correct port?

Default is 3306

Firewall blocking?

See below

Windows Firewall Issues

Fix:

  1. Open Windows Defender Firewall
  2. Click "Allow an app through firewall"
  3. Look for MySQL Server in the list
  4. Make sure both Private and Public are checked
  5. If not in the list, click "Allow another app" and browse to:
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe

MySQL Installer Won't Open

Fix:

  1. Make sure you downloaded the .msi file (not .zip)
  2. Right-click the file and select "Run as administrator"
  3. If it still fails, install Visual C++ Redistributable from Microsoft first

Common Error Messages

Error

Meaning

Fix

ERROR 1045 (28000)

Access denied (wrong password)

Check your root password

ERROR 2003 (HY000)

Cannot connect to server

Start MySQL service

ERROR 1049 (42000)

Unknown database

Check spelling, run SHOW DATABASES;

ERROR 1146 (42S02)

Table does not exist

Check spelling, run SHOW TABLES;

ERROR 1064 (42000)

SQL syntax error

Check for typos, missing semicolons

HitaVir Tech says: "90% of MySQL issues come down to: (1) the service is not running, (2) wrong password, or (3) wrong port. Check these three things first before Googling the error."

Congratulations! You have successfully set up MySQL on your Windows computer!

What You Accomplished

Step

Status

Downloaded MySQL Installer

Done

Installed MySQL Server

Done

Configured root password

Done

Installed MySQL Workbench

Done

Connected to the database

Done

Created a database and table

Done

Ran SELECT, INSERT, UPDATE queries

Done

Imported a .sql database file

Done

Learned troubleshooting steps

Done

Quick Revision Checklist

What to Learn Next

Topic

Why It Matters

SQL SELECT (WHERE, ORDER BY, LIMIT)

Filtering and sorting data

SQL JOINs (INNER, LEFT, RIGHT)

Combining data from multiple tables

SQL Aggregations (GROUP BY, HAVING)

Summarizing data for reports

Subqueries and CTEs

Complex data analysis

Indexes and optimization

Making queries faster

Stored procedures

Reusable SQL logic

Python + MySQL

Connecting pipelines to databases

Your Learning Path

MySQL Setup (you are here!)
    │
    ▼
SQL Basics (SELECT, INSERT, UPDATE, DELETE)
    │
    ▼
SQL Intermediate (JOINs, GROUP BY, Subqueries)
    │
    ▼
SQL Advanced (Window Functions, CTEs, Optimization)
    │
    ▼
Python + MySQL (SQLAlchemy, pandas)
    │
    ▼
Data Engineering (ETL Pipelines with SQL)

HitaVir Tech says: "You now have a professional database environment on your computer. This is the same setup used by data engineers worldwide. SQL is the universal language of data — everything you learn here transfers directly to PostgreSQL, BigQuery, Snowflake, and every other database. Keep practicing, keep querying, and keep growing!"

You have successfully completed the MySQL Workbench Setup and Installation Guide by HitaVir Tech!

What You Built

Keep Practicing

Open MySQL Workbench daily and write queries. The more you practice SQL, the more natural it becomes.

Happy querying!