MySQL is one of the most popular relational database management systems (RDBMS) used by developers worldwide. Whether you’re building a website, a software application, or learning about databases, you’ll need MySQL for managing and organizing your data. In this guide, we’ll walk you through how to install MySQL on Windows, step by step. By the end of this tutorial, you’ll have MySQL up and running, ready to start managing your databases!
Step 1: Download MySQL Installer
The first step is to download the MySQL installer. Here’s how:
- Visit the official MySQL website: MySQL Downloads.
- Under MySQL Community Edition, click on the Windows platform.
- Choose the MySQL Installer for Windows. You’ll see two options:
- MySQL Installer Web Community (smaller download, requires an internet connection during installation).
- MySQL Installer Offline (larger file, includes all necessary components).
For most users, I recommend choosing the MySQL Installer Web Community for convenience.
Step 2: Run the MySQL Installer
Once the MySQL installer is downloaded, follow these steps:
- Locate the Installer: Go to your Downloads folder (or wherever the installer was saved) and double-click to launch it.
- Start Installation: The installer will start and give you several options. You can choose between:
- Developer Default: Installs MySQL Server, MySQL Workbench, and other development tools.
- Server Only: Installs just MySQL Server.
- Client Only: Installs MySQL Workbench and other client tools.
- Custom: Lets you select specific components.
If you’re new to MySQL, I recommend choosing Developer Default, as it installs everything you need to get started.
Step 3: Configure MySQL
During the installation, the installer will guide you through the configuration process. Follow these steps:
- Choose Setup Type: After selecting the components to install, you’ll be asked to configure MySQL. You can select the default configuration, which should work for most users.
- MySQL Root Password: You’ll be prompted to set the root password for MySQL. This is an important step, so choose a strong password and remember it, as you’ll need it to log in to MySQL later.
- Windows Service: MySQL will be installed as a Windows service. You can choose to have it start automatically when your computer starts or manually, depending on your preference.
- Port Configuration: The default port for MySQL is 3306. You can leave this as the default or change it if necessary (e.g., if another service is using that port).
Step 4: Complete the Installation
Once you’ve finished the configuration, the installer will proceed to install MySQL. The installation process may take a few minutes.
After the installation is complete, you’ll see a success message, and the installer will give you the option to launch MySQL Workbench and the MySQL Shell. You can choose to start these programs right away or skip this step and start them later.

Read Here How to Install
Step 5: Verify MySQL Installation
Now that MySQL is installed, it’s time to make sure everything is working correctly.
- Open the Command Prompt: Press
Windows Key + R
, typecmd
, and press Enter to open the Command Prompt. - Access MySQL: To check if MySQL is running, type the following command:bashCopy
mysql -u root -p
After pressing Enter, you’ll be asked to enter the root password you set during installation. - Login to MySQL: Once you’ve entered the correct password, you should be logged into the MySQL command line interface (CLI). You’ll see the MySQL prompt (
mysql>
), confirming that MySQL is installed and running properly.
Step 6: Using MySQL Workbench (Optional)
If you prefer using a graphical user interface (GUI) instead of the command line, you can use MySQL Workbench, which is a powerful tool for managing MySQL databases.
- Launch MySQL Workbench: Open MySQL Workbench from the Start menu or desktop shortcut.
- Connect to MySQL: When you first open MySQL Workbench, click the
+
button next to MySQL Connections to set up a new connection. Enterlocalhost
for the hostname,root
for the username, and the root password you set during installation. - Start Using MySQL Workbench: After connecting, you can start creating databases, tables, and queries directly from the Workbench interface.
Step 7: Stopping MySQL
If you ever need to stop MySQL, you can do so in a few different ways:
- Using MySQL Workbench: If you’re using MySQL Workbench, you can stop the MySQL server by navigating to the Server menu and selecting Startup/Shutdown.
- Using Command Prompt: If you’re using the command line, you can stop MySQL with the following command:bashCopy
mysqladmin -u root -p shutdown
Enter your root password when prompted, and MySQL will stop. - Using Services: MySQL is installed as a Windows service, so you can stop it through the Windows Services Manager:
- Open Run (Windows Key + R), type
services.msc
, and press Enter. - Find MySQL in the list of services, right-click it, and select Stop.
- Open Run (Windows Key + R), type
Troubleshooting MySQL Installation Issues
Here are some common installation problems and solutions:
- MySQL Not Starting:
- Make sure no other application is using the default MySQL port (3306). If there’s a conflict, change the port number during the installation or in the MySQL configuration file (
my.ini
).
- Make sure no other application is using the default MySQL port (3306). If there’s a conflict, change the port number during the installation or in the MySQL configuration file (
- Access Denied Error:
- If you see an error when logging in to MySQL, double-check that you’re using the correct root password. You can reset the root password if needed by following MySQL’s official documentation.
- MySQL Not Found in Command Prompt:
- If MySQL is not recognized as a command, it might not be added to your system’s PATH variable. You can manually add MySQL to your PATH by modifying the system environment variables.
Conclusion
Congratulations! You’ve successfully install MySQL on Windows machine. Now you can start creating and managing databases with ease. Whether you’re working on a web project or a software application, MySQL will serve as a robust and efficient database management system.
If you ran into any issues during installation or need more advanced configurations, don’t hesitate to refer to the official MySQL documentation or community forums. Enjoy working with MySQL, and happy coding!