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.
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).
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.
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) |
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."
This guide assumes zero experience with databases or SQL. We start from downloading the installer.
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.
Open your browser and go to:
https://dev.mysql.com/downloads/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.
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.
The file will be named something like:
mysql-installer-community-8.0.xx.msi
Save it to your Downloads folder.
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.
mysql-installer-community-8.0.xx.msiThe 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:
The installer may show missing requirements (like Visual C++ Redistributable). Click Execute to install them automatically, then click Next.
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.
If you chose Custom instead of Developer Default:
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.
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.
Select "Use Strong Password Encryption for Authentication (RECOMMENDED)"
This uses the modern caching_sha2_password authentication. Click Next.
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:
HitaVir2026!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.
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.
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.
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.
You will see the Welcome screen with:
Click on Local instance MySQL80 (the grey tile showing root and localhost:3306).
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.
You should now see the MySQL Workbench main interface with:
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.
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.
CREATE DATABASE hitavir_db;
Expected output:
1 row(s) affected
SHOW DATABASES;
You should now see hitavir_db in the list!
USE hitavir_db;
This tells MySQL: "I want to work with the hitavir_db database now."
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
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
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 |
+------------+------------+-----------+--------------------+-------+-----------------+
SELECT first_name, last_name, email
FROM students
WHERE batch = 5;
SELECT batch, COUNT(*) AS total_students
FROM students
GROUP BY batch;
Expected output:
+-------+----------------+
| batch | total_students |
+-------+----------------+
| 4 | 2 |
| 5 | 3 |
+-------+----------------+
UPDATE students
SET email = 'priya.sharma@hitavir.tech'
WHERE student_id = 1;
Command | Purpose | Example | |
| List all databases | ||
| Create new database |
| |
| Switch to a database |
| |
| Create a new table | See above | |
| Add rows to a table | See above | |
| Read data |
| |
| Modify existing data |
| |
| Remove rows |
| |
| Delete a table |
| |
| Delete a database |
| |
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.
In MySQL Workbench, click the "Create a new schema" icon (cylinder icon in the toolbar).
farmers_marketYou should see farmers_market appear in the left panel under SCHEMAS.
Go to the menu bar:
Server → Data Import
A new tab called "Administration - Data Import / Restore" opens.
In the Import from Disk tab:
Setting | Value |
Import from | Self-Contained File (select this radio button) |
File path | Browse to your downloaded |
Default Target Schema | Select |
At the bottom right, select: Dump Structure and Data
Expected output:
Import Completed
Status: 1 of 1 imported
farmers_marketfarmers_market → TablesYou should see the imported tables listed.
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.
Symptom: MySQL Workbench cannot connect, error "Can't connect to MySQL server"
Fix:
Win + R, type services.msc, press EnterOr from Command Prompt (run as Administrator):
net start MySQL80
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.
Symptom: Cannot connect to MySQL, password rejected
Fix (Windows):
net stop MySQL80mysqld --skip-grant-tables --shared-memory
mysql -u root
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword123!';
FLUSH PRIVILEGES;
net start MySQL80Symptom: "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 |
Fix:
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe
Fix:
.msi file (not .zip)Error | Meaning | Fix |
| Access denied (wrong password) | Check your root password |
| Cannot connect to server | Start MySQL service |
| Unknown database | Check spelling, run |
| Table does not exist | Check spelling, run |
| 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!
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 |
SHOW DATABASES; to list all databasesUSE database_name; before querying tablesSHOW TABLES; to see tables in the current database;)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 |
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!
hitavir_db) with a students tableOpen MySQL Workbench daily and write queries. The more you practice SQL, the more natural it becomes.
Happy querying!