# Install MySQL Server on Windows

Whether you're setting up MySQL for a development project or for learning purposes, this guide will make the process straightforward and easy to follow.

# Download

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726159470750/2064c46e-b214-463b-9562-4b40535d5e7f.png align="center")

To get started, head to the MySQL Community Downloads page and download the installer for Windows. Make sure to select the correct version and architecture (32-bit or 64-bit) based on your system requirements.

[https://dev.mysql.com/downloads/installer/](https://dev.mysql.com/downloads/installer/)

---

# Install

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726159505296/b236be10-f6c0-4b55-84cf-f1db1778df07.png align="center")

**Apply Updates Screen:**  
The MySQL Installer is applying updates to MySQL Server and other products.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726159546056/97f9f50e-8a0d-4bd1-9838-8fe9bbc640cf.png align="center")

* **Product Configuration:**  
    The configuration wizard is ready to configure MySQL Server and examples.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726159552264/467521cf-c134-4abf-810e-d6478cd75f26.png align="center")

**Type and Networking:**

* Select the server type and network settings for your MySQL installation.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726160385164/9213b1ff-44ed-433c-8d77-82d72259bd0f.png align="center")

**Accounts and Roles:**  
Set a password for the root account and add other user accounts if needed.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726160527060/60bcaf50-889a-487f-8a93-ebd46df849dd.png align="center")

**Windows Service:**  
Configure MySQL Server to run as a Windows service and start automatically.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726160532989/1295f561-d588-406b-b160-6f1e3a5441ef.png align="center")

**Server File Permissions:**  
Choose the level of access for MySQL Server's data files.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726160538308/53912812-81a3-45c4-aabe-eda142e14c8b.png align="center")

* **Apply Configuration:**  
    Apply the configuration changes and start the MySQL server.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726160581064/a3d10497-52d0-451f-93c6-c41baf2ffb19.png align="center")

**Product Configuration Finished:**  
MySQL Server configuration is complete and ready to use.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726160586256/7c0a63e0-3d6b-4ccc-8d8a-469f4b7c2add.png align="center")

**Final Configuration:**  
The installer is running final scripts to complete the setup.

---

# MySQL Installation Directory

This is the `bin` directory where the MySQL Server binaries are stored, located at `C:\Program Files\MySQL\MySQL Server 8.0\bin`.

C:\\Program Files\\MySQL\\MySQL Server 8.0\\bin

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726161137858/3b7859d6-5b97-452a-8298-31eeb70e0f68.png align="center")

---

# Open System Environment Variables

* Search for "Edit the system environment variables" in the Start menu to open the settings.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726161159624/ad7da472-cbd6-46b3-bad9-11307d45815f.png align="center")

# Edit Environment Variables

* Click on the "Path" variable in System Variables and then click "Edit."
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726161192656/84359e2c-0102-458c-a6be-ee31b2cc3674.png align="center")

# Add MySQL Path

Add the MySQL bin directory path (`C:\Program Files\MySQL\MySQL Server 8.0\bin`) to the system path.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726161231424/80e2fc1a-eb54-4114-9f8c-415edd30266d.png align="center")

---

# Connect to MySQL as Root User

Use the command `mysql -u root -p` to log in to MySQL with the root user. You will need to enter your password to access the MySQL monitor.

```bash
mysql -u root -p
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726161302834/509b50fc-50e5-4726-ad2b-65854edcbea5.png align="center")

---

# Show Databases

Use the `show databases;` command to list all databases in your MySQL server.

```bash
show databases;
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726161361967/4e82abae-5e8e-44d0-b434-83f381bba2b4.png align="center")

---

# Exit

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726161438750/78ed4ffe-023e-435f-bb59-abb8918cec6d.png align="center")
