Install MySQL on Windows Like a Pro

Install MySQL natively on Windows and manage two databases from one tool.

Introduction

30 Second Summary

Every time you want to talk to your database, you open Docker Desktop, wait for it to start, and manually click Run. Then you write your queries in notepad and paste them into a terminal window.

In this project, you will install MySQL directly on Windows so it starts automatically with your PC. You will also set up MySQL Workbench, a professional editor that manages both your native and Docker databases from one place.

What You'll Build

Picture opening your laptop, typing one command, and landing in a MySQL prompt instantly. No Docker Desktop, no notepad, no waiting.

By the end of this project, you'll have:

  • A native MySQL server that boots with Windows and is instantly available in any terminal. No Docker Desktop required.
  • Both MySQL instances managed from one application, with your native MySQL on port 3307 and Docker MySQL on port 3306 running side by side.
  • A proper query editor where you write, save, and rerun SQL with syntax highlighting and auto-complete instead of notepad.
  • Secret Mission: Build a sample database on your native MySQL and explore Workbench's visual schema tools.

Are there any prerequisites?

This project picks up where your Docker MySQL setup left off. You need Windows 11 and Docker Desktop with a MySQL container already running on port 3306.

Before We Start

Before we dive in, let's lock in what you're about to build and why it matters.

Download MySQL Server and Workbench

Your current MySQL setup depends on Docker Desktop being open and the container running. A native MySQL installation runs as a Windows service that auto-starts with your PC, removing Docker from the equation entirely.

Before you can install MySQL natively, you need the installer files. MySQL 8.4 uses standalone MSI files instead of the old bundled MySQL Installer, so you will download MySQL Server and MySQL Workbench as two separate files.

In this step, get ready to:
  • Download the MySQL Community Server 8.4.11 installer.
  • Download the MySQL Workbench 8.0.47 installer.
  • Confirm your Docker MySQL container is running on port 3306.
Download the MySQL Community Server installer
  • Open your browser and go to the MySQL Community Server download page.
  • In the Select Operating System dropdown, select Microsoft Windows.
  • Find the row labelled Windows (x86, 64-bit), MSI Installer and click Download. The file is named mysql-8.4.11-winx64.msi and is approximately 130 MB.
  • You will be redirected to an Oracle login page. Click No thanks, just start my download at the bottom of the page to skip account creation and begin the download.

Why are Server and Workbench separate downloads?

MySQL 8.0 was the final version that shipped with the bundled MySQL Installer (the all-in-one tool that could install Server, Workbench, and other components together). Starting with MySQL 8.1, each product ships its own standalone MSI file.

MySQL Server 8.1 and higher also bundle MySQL Configurator, a tool that helps you configure the server after installation. You will use it in the next step.

Download MySQL Workbench
  • In your browser, go to the MySQL Workbench download page.
  • In the Select Operating System dropdown, select Microsoft Windows.
  • Find the row labelled Windows (x86, 64-bit), MSI Installer and click Download. The file is named mysql-workbench-community-8.0.47-winx64.msi and is approximately 255 MB.
  • Click No thanks, just start my download to skip the Oracle account login, the same way you did for the server installer.
Verify your downloads and Docker container

Both downloads need to finish before you can move on. While they complete, confirm that your Docker MySQL container is still running on port 3306.

  • Press Windows + E to open File Explorer.
  • Navigate to your Downloads folder.
  • Confirm you see both mysql-8.4.11-winx64.msi and mysql-workbench-community-8.0.47-winx64.msi listed.
  • Press the Windows key to open your search bar.
  • Type Command Prompt and press Enter to open it.

Before you run the next command, what do you expect to see when you list the running Docker containers?

  • Confirm your Docker MySQL container is running by running this command:
docker ps

You should see your MySQL container listed with 0.0.0.0:3306->3306/tcp in the PORTS column. Leave Docker running. You will use this container later to demonstrate a port conflict.

Don't see your MySQL container?

  • If docker ps returns an empty list, your container may be stopped. Open Docker Desktop and click the play button next to your MySQL container to start it, then run docker ps again.
  • If you see an error that Docker is not recognized, Docker Desktop may not be running. Open Docker Desktop first, wait for it to finish starting, then retry the command.

Help me troubleshoot my Docker MySQL container not showing up in docker ps.

Both installers are ready to go. Next up, you will install MySQL Server and discover what happens when two services try to use the same port.

Install MySQL Server and Hit the Port Conflict

Your installers are downloaded and your Docker MySQL container is confirmed running on port 3306. Time to install MySQL Server natively on Windows.

A native MySQL installation runs as a Windows service. It starts automatically every time your PC boots, with no need to open Docker Desktop or click anything.

In this step, get ready to:
  • Install MySQL Server 8.4 LTS using the MSI installer.
  • Configure MySQL using MySQL Configurator.
  • Discover what happens when two services try to use the same port.
Run the MySQL Server installer

The MySQL Server 8.4 MSI installs the server binaries onto your machine. It also bundles MySQL Configurator, the tool you will use to set up the server right after installation.

  • Open your Downloads folder in File Explorer.
  • Right-click mysql-8.4.11-winx64.msi and select Install.
  • Accept the license agreement when prompted.
  • Keep the default installation directory set to C:\Program Files\MySQL\MySQL Server 8.4.
  • Click Install to run the installation.
  • When the wizard finishes, check the option to launch MySQL Configurator.
  • Click Finish.

MySQL Configurator opens automatically.

Seeing a prerequisites error?

MySQL 8.4 requires the Microsoft Visual C++ 2019 Redistributable Package. If the installer shows a missing prerequisite warning, download the redistributable from Microsoft's website, install it, and then retry the MySQL installation.

help me fix a prerequisites error during MySQL 8.4 installation on Windows

Walk through the MySQL Configurator

What is MySQL Configurator?

The old bundled MySQL Installer was retired after MySQL 8.0. Starting with MySQL 8.1, each product ships its own MSI, and MySQL Server bundles MySQL Configurator for setup and reconfiguration.

MySQL Configurator creates your my.ini configuration file, sets up the Windows service, and configures your root password. It walks you through each setting one page at a time.

MySQL Configurator walks you through several configuration pages. Follow each one as described below.

  • On the Type and Networking page, select Development Computer as the configuration type.
  • In the Connectivity section on the same page, leave TCP/IP enabled and keep the port set to 3306.
  • On the Accounts and Roles page, enter a root password you will remember.
  • On the Windows Service page, keep Configure MySQL Server as a Windows Service checked.
  • Keep Start the MySQL Server at System Startup checked.
  • Note the service name displayed. It should be MySQL84.
  • Click through the remaining pages (Server File Permissions and Sample Databases) keeping the defaults until you reach the Apply Configuration page.

Why Development Computer?

The Development Computer setting tells MySQL to use the least amount of memory. Your machine is running other applications (Docker, your browser, your editor), so this keeps MySQL lightweight and avoids hogging resources.

Pick a simple root password

This is a local development server, not a production database. A short, memorable password works fine. You will need it again in the next step and when connecting from MySQL Workbench.

Execute the configuration

You are now on the Apply Configuration page. Your Docker MySQL is already running on port 3306, and you just told MySQL Configurator to start a new MySQL server on port 3306 too. What do you think will happen?

  • Click Execute to apply the configuration.

Watch the Configuration Steps tab. The icon for each step toggles from white to green on success. Several steps succeed, but the step that starts the MySQL server stops and displays an error.

The server failed to start because port 3306 is already occupied by your Docker MySQL container. Two programs cannot listen on the same network port at the same time. This is exactly the result we wanted to see.

  • Click Cancel or Back to exit the Configurator without completing the configuration.

What is a port conflict?

A network port is like a numbered door on your computer. When a program (like Docker MySQL) opens door 3306 and starts listening for connections, no other program can open that same door.

Your Docker MySQL claimed port 3306 first. When the native MySQL server tried to start on the same port, the operating system refused. The fix is simple: give the new server its own port number.

All configuration steps succeeded?

If every step shows a green checkmark and MySQL started without errors, your Docker MySQL container might not be running on port 3306. Open a terminal and run docker ps to check. If the container is not listed, start it and rerun the Configurator to see the port conflict.

help me troubleshoot MySQL Configurator not showing a port conflict error

You have seen exactly why MySQL cannot start with the default settings. In the next step, you will fix this port conflict by giving your native MySQL its own port, so both databases can run side by side.

Fix the Port Conflict and Start MySQL

In the previous step, you proved that two services cannot share the same port. Your Docker MySQL already occupies port 3306, so the native MySQL server could not start on that same address.

The fix is to give each MySQL instance its own port. You will reconfigure native MySQL to listen on port 3307, so both databases can run side by side without conflicts.

In this step, get ready to:
  • Reconfigure MySQL to use port 3307 using MySQL Configurator.
  • Connect to native MySQL from the command line.
  • Verify the server version and inspect the default databases.
Reconfigure MySQL to use port 3307

MySQL Configurator can be re-run from the Start menu to change your server's settings. This time, you will assign a different port so it no longer collides with Docker.

  • Press the Windows key to open the search bar.
  • Type MySQL Configurator and press Enter to open it.
  • In the Networking step, change the Port from 3306 to 3307.
  • Leave the X Protocol Port at 33060. If it prompts you to change it, set it to 33070.
  • Confirm that Server Configuration Type is set to Development Computer, your root password is the same one you chose earlier, and Start the MySQL Server at System Startup is checked.

Before you apply, what do you think will happen this time? The only change is the port number.

  • Click Execute to apply the configuration.

All configuration steps should complete with green checkmarks. MySQL is now running as a Windows service on port 3307.

What just happened?

By changing the port to 3307, your native MySQL now has its own address that does not conflict with Docker MySQL on 3306. Both databases can run simultaneously on the same machine.

The Configurator also registered MySQL as a Windows service named MySQL84. This service starts automatically every time Windows boots, so you never need to launch MySQL manually.

Still seeing a failed configuration step?

  • Double-check that you changed the port to 3307, not left it at 3306. Go back to the Networking step and confirm the value.
  • Make sure your Docker MySQL container is the only process using port 3306. If another application grabbed port 3307, try 3308 instead.
  • Why is MySQL Configurator still failing after I changed the port?
Connect to native MySQL and verify it is running

Green checkmarks in the Configurator are a good sign, but the real proof is connecting to the server and running a query. You will use the MySQL command-line client to verify the server is alive on port 3307.

  • Press the Windows key to open the search bar.
  • Type cmd and press Enter to open a new Command Prompt window.
  • Connect to your native MySQL by running this command:
"C:\Program Files\MySQL\MySQL Server 8.4\bin\mysql" -u root -p -P 3307
  • Enter the root password you set during configuration when prompted.

You should see the mysql> prompt, confirming you are connected to your native MySQL server.

What does this command do?

  • The full path in quotes points to the mysql client inside your MySQL installation folder. Quotes are needed because the path contains spaces.
  • -u root tells the client to log in as the root user.
  • -p tells the client to prompt you for a password instead of sending it in plain text.
  • -P 3307 specifies the port. Without this, the client defaults to 3306 and would connect to your Docker MySQL instead.

Can't connect?

  • Make sure you typed -P 3307 with a capital P. A lowercase -p means password, not port.
  • If the password is rejected, re-enter it carefully. This is the password you set in MySQL Configurator, not your Docker MySQL password.
  • If you see a connection refused message, the MySQL service may not be running. Search for Services in the Start menu, find MySQL84, and confirm its status is Running.
  • Why can't I connect to my native MySQL on port 3307?

Before you run your first query, what MySQL version do you expect to see?

  • Check your server version by running this query at the mysql> prompt:
SELECT VERSION();

You should see 8.4.11 (or a similar 8.4 version) in the output. That confirms your native MySQL is alive and listening on port 3307.

  • See what databases come pre-installed by running:
SHOW DATABASES;

You should see the four default system databases: information_schema, mysql, performance_schema, and sys. These are MySQL's internal housekeeping databases.

  • Disconnect from the MySQL CLI by typing:
exit

Your native MySQL is alive and listening on its own port. Next up, you will install MySQL Workbench and connect to both your native and Docker databases from a single professional query environment.

Set Up MySQL Workbench and Connect to Both Databases

Your native MySQL and Docker MySQL are running side by side on separate ports. The port conflict is solved, and both databases are ready for queries.

Right now, your workflow for running SQL involves writing queries in notepad and pasting them into the command line. MySQL Workbench is a professional database client that gives you syntax highlighting, auto-complete, tabbed queries, and tabular results. It can manage both your MySQL instances from a single application.

In this step, get ready to:
  • Install MySQL Workbench on your Windows machine.
  • Create a connection to your native MySQL on port 3307.
  • Create a connection to your Docker MySQL on port 3306 and verify both instances from one application.
Install MySQL Workbench

MySQL Workbench is a visual database tool made by Oracle. It replaces the notepad-and-CLI workflow with a proper editor that has syntax highlighting, auto-complete, and tabular results.

  • Open your Downloads folder and find the mysql-workbench-community-8.0.47-winx64.msi file.
  • Right-click the file and select Install.
  • Accept the default settings in the installer wizard and click through to complete the installation.

Installer won't run?

  • MySQL Workbench requires the Microsoft Visual C++ 2019 Redistributable Package and Microsoft .NET Framework 4.5. If the installer mentions missing prerequisites, download and install them from Microsoft's website, then re-run the Workbench installer.
  • If Windows blocks the file, right-click the MSI, select Properties, check Unblock at the bottom of the dialog, and try again.
  • Why can't I install MySQL Workbench on Windows?
  • Press the Windows key to open your search bar.
  • Type MySQL Workbench and press Enter to open it.

The Workbench home screen appears. You may see a default connection tile already listed. Ignore it for now.

Create a connection to your native MySQL

Each connection in Workbench needs a hostname, port, and username. Your native MySQL runs on port 3307, so you will create a connection pointing there.

  • Click the + icon next to MySQL Connections on the home screen.
  • Enter Native MySQL (3307) in the Connection Name field.
  • Enter 127.0.0.1 in the Hostname field.
  • Change the Port field from 3306 to 3307.
  • Enter root in the Username field.
  • Click Test Connection.
  • Enter your root password when prompted and click OK.

A success message confirms the connection works. Click OK to close the test dialog, then click OK again to save the connection.

The Native MySQL (3307) tile now appears on your home screen.

Test connection failed?

  • Make sure your MySQL service is running. Open a terminal and run net start MySQL84 to start it if needed.
  • Double-check that you set the port to 3307, not 3306. Port 3306 belongs to your Docker MySQL.
  • Confirm you are entering the root password you set during MySQL Configurator setup.
  • Why is my MySQL Workbench test connection to port 3307 failing?
Connect to your Docker MySQL and verify both instances

Now create a second connection for your Docker MySQL on port 3306. Having both connections on one screen is the payoff of running two instances on separate ports.

  • Click the + icon next to MySQL Connections again.
  • Enter Docker MySQL (3306) in the Connection Name field.
  • Confirm the Hostname is 127.0.0.1.
  • Confirm the Port is 3306.
  • Enter root in the Username field.
  • Click Test Connection.
  • Enter the root password you set for your Docker MySQL container and click OK.

Another success message appears. Click OK to close the test dialog, then click OK to save.

Both connection tiles now sit side by side on the Workbench home screen.

Docker MySQL connection failed?

  • Make sure Docker Desktop is running and your MySQL container is active. Open a terminal and run docker ps to check.
  • Confirm the port is 3306, matching your Docker container's mapped port.
  • The Docker MySQL root password may be different from your native MySQL root password. Enter the one you set when you created the Docker container.
  • Why can't MySQL Workbench connect to my Docker MySQL container on port 3306?

Time to prove these are two separate databases. Before you check, predict: will both connections return the same MySQL version number, or different ones?

  • Double-click the Native MySQL (3307) connection tile to open it.
  • A query tab opens. Type the following query into the editor and click the execute button (lightning bolt icon) in the toolbar, or press Ctrl+Enter:
SELECT VERSION();
  • Note the version number in the results grid below the editor.
  • Click the Home tab (house icon at the top) to return to the home screen.
  • Double-click the Docker MySQL (3306) connection tile to open it.
  • In the new query tab, type and run the same query:
SELECT VERSION();

Each tab returns a different version number. Your native MySQL shows an 8.4 version, and your Docker MySQL shows whatever version your container image uses. Two separate databases, managed from one application.

Why are the versions different?

Your native MySQL is the 8.4 LTS release you installed in the previous steps. Your Docker MySQL runs whatever version the container image was built from.

Different version numbers confirm these are truly independent MySQL servers, not two windows into the same database.

Secret mission

Build a Sample Database and Explore Visual Schema Tools

You have two MySQL instances connected in Workbench, but a professional workflow means more than just connecting. In this mission, create a real database, populate it with data, and discover Workbench features that make database design and exploration dramatically easier than the command line.

Clean Up Your Resources

Clean Up Your Resources

Decide whether to keep your resources running, pause them to come back later, or delete them entirely. This project runs entirely locally with no ongoing cloud costs, though the MySQL service uses a small amount of memory while running in the background.

Resources you used:

  • MySQL Server 8.4 LTS and the MySQL84 Windows service (port 3307), installed at C:\Program Files\MySQL\MySQL Server 8.4.
  • MySQL Workbench 8.0.47, installed at C:\Program Files\MySQL\MySQL Workbench 8.0.
  • bookstore database on native MySQL and the exported SQL dump file.

Keep everything running

No action needed. Choose this if you are still actively building or plan to use your native MySQL setup regularly.

  • MySQL starts automatically as a Windows service every time your PC boots. No manual steps required.
  • MySQL Workbench and your saved connections (Native MySQL (3307) and Docker MySQL (3306)) are available from the Start menu whenever you need them.
  • Your bookstore database and SQL dump file persist across restarts.

Pause - I'll come back to this later

Stop the MySQL service to free up memory while keeping everything installed. Your databases, Workbench connections, and SQL dump file are all preserved for when you return.

  • Close MySQL Workbench.
  • Stop the MySQL84 service by running this command in a terminal:
net stop MySQL84
  • Disable auto-start so MySQL does not restart on boot. Press the Windows key, type Services, and press Enter.
  • Find MySQL84 in the list. Right-click it and select Properties.
  • Change Startup type to Manual and click OK.

Resuming later

To start MySQL again, open a terminal and run net start MySQL84. To re-enable auto-start on boot, return to Services and set Startup type back to Automatic.

Delete - I don't want to use this again

Remove everything you installed in this project and start fresh.

  • If you imported bookstore into Docker MySQL during the Secret Mission, open the Docker MySQL (3306) connection in Workbench first. Run DROP DATABASE bookstore; in a query tab to remove it.
  • Close MySQL Workbench.
  • Stop the MySQL84 service by running this command in a terminal:
net stop MySQL84
  • Open Settings on your Windows machine.
  • Select Apps, then Installed apps.
  • Search for MySQL. You should see entries for MySQL Server and MySQL Workbench.
  • Click the three-dot menu next to MySQL Server and select Uninstall. Follow the prompts to complete the removal.
  • Repeat for MySQL Workbench. Click the three-dot menu and select Uninstall.
  • Delete leftover MySQL data files by running this command in a terminal:
rmdir /s /q "C:\ProgramData\MySQL\MySQL Server 8.4"
  • Delete the bookstore SQL dump file you exported earlier from wherever you saved it.

Nice Work!

Nice Work!

You just installed a production-grade MySQL setup on your Windows machine with two database instances running side by side and a professional tool to manage them both.

Here's what you learned:

  • Installed MySQL 8.4 LTS natively on Windows and configured it as a Windows service that auto-starts on boot.
  • Diagnosed a port conflict between native MySQL and Docker MySQL, then fixed it by assigning port 3307 to the native instance so both databases run simultaneously.
  • Set up MySQL Workbench as a professional query environment and connected to both MySQL instances from a single application, replacing the notepad-and-CLI workflow.
  • (Secret Mission) Built a sample bookstore database with related tables, visualized the schema with an EER diagram, and exported/imported data between instances.

Ready to quiz yourself?