ReactSensei

Add MySQL Install Instructions Windows

June 27, 2020

  • Navigate to the MySQL Community Downloads page for the MySQL Community Server.
  • Select Microsoft Windows from the Operating System dropdown menu.
  • Click on “Go to Download Page” for Windows (x86, 32 & 64-bit), MySQL Installer MSI

MySQL Server Win

  • Find the Windows (x86, 32-bit), MSI Installer that is the smaller size.

MySQL Server Win2

  • Click the “Download” button.
  • When prompted about signing up for a free Oracle Web Account, click “No thanks, just start my download.”

"Login" and "Sign Up" buttons appear under "MySQL Community Downloads", with "No thanks, just start my download," at bottom of screen.

  • Navigate to the folder where the file was downloaded and double-click to run the installer. If you get prompted for an update, proceed with the upgrade.
  • On the “Choosing a Setup Type” screen, make sure that “Server Only” is selected, and click on “Next”.

On the Choosing a Setup Type page, Server Only is selected, with Next highlighted at the bottom of the screen.

  • On the “Installation” screen, you’ll see your product listed (it should say “MySQL Server”, followed by a version number). Click on “Execute”.

On Installation screen, "MySQL Server 8.0.19" is highlighted, with "Execute" highlighted at the bottom of the screen.

  • Once the installation is complete, click on “Next”.
  • On the “Product Configuration” screen, click on “Next”.
  • On the “High Availability” screen, make sure “Standalone MySQL Server / Classic MySEL Replication” is selected and click on “Next”.

Under High Availability, "Standalone MySQL Server / Classic MySQL Replication" is selected, with Next highlighted at bottom of screen.

  • On the “Type and Networking” screen, don’t change anything and click “Next”
  • IMPORTANT: On the “Authentication Method” screen, make sure to select “Use Legacy Authentication Method (Retain MySQL 5.x Compatibility)” and click “Next”

"Use Legacy Authentication Method (Retain MySQL 5.x Compatibility) is selected, with Next selected at bottom of screen.

  • On the “Accounts and Roles” screen, create a root password. WARNING: Do not forget this password! It’s extremely important that you keep track of your root password for MySQL, as it is difficult to reset. Make sure that you write it down somewhere you can find it or add it to a password manager.

Under Accounts and Roles, a password has been entered twice and designated as Strong.

  • After entering a password, click “Next”
  • On the “Windows Service” screen, don’t change anything and click “Next”
  • Finally, on the “Apply Configuration” screen, click “Execute” to apply the changes.

Under Apply Configuration, no options are selected, and Execute is highlighted at bottom of page.

  • After the configuration is complete, click “Finish”
  • Now that we have installed MySQL, we need to make sure to add the PATH to the MySQL install to our Environmental Variables.

PATH setup

  • Open any folder on your computer and click on “This PC” in the left-hand navigation bar.

"This PC" is selected in the navigation bar.

  • Next, double-click on your C: drive.

Under "Devices and drives", the `C:` drive is highlighted.

  • Double-click on the folder named “Program Files”, then double-click on the “MySQL” folder.

    • Note: Depending on the version of Windows you have on your computer, MySQL may be inside of the Program Files (x86) folder.
  • Double-click on the “MySQL Server 8.0” folder, then double-click on the folder named bin. Your screen should look like the following image:

The file path to the `bin` folder is highlighted at the top of the screen.

  • Right-click the address at the top of the screen and select “Copy address as text”

The file path at the top of the screen has been selected, with "Copy address as text" selected on the menu.

  • Now that you’ve got the PATH copied to your clipboard, press the Windows key on your keyboard and search for “Edit the system environmental variables”. Once that shows up in the search screen, click on it.

"Edit the system environment variables" is highlighted at the top of the search results.

  • On the System Properties screen, under the “Advanced” tab, click on “Environment Variables”

In the Advanced tab on the System Properties screen, Environment Variables is highlighted in green at the bottom.

  • On the “Environment Variables” screen, under the section that says “User variables for <user>” (where <user> is your username on that computer), click “Path” and then click on the “Edit…” button.

On the Environment Variables screen, Path is selected and highlighted, with the "Edit…" button also highlighted.

  • On the “Edit environment variable” screen, click on “New…”

"New..." button is selected on the "Edit environment variable" screen.

  • Your cursor will appear in a new line at the bottom of the variables. Paste your PATH in this box and click “OK”.

On the "Edit environment variable" screen, an empty box is highlighted, and OK is highlighted  at the bottom of the screen.

  • Click “OK” on any remaining screens, then restart Git Bash completely.
  • You can verify that the installation was correct by going to Git Bash and typing the following:

    mysql -V
  • The PATH, followed by the MySQL version number, should be printed to the screen.
  • Once you verify that the MySQL Server was correctly installed, move onto setting up the MySQL Shell below.

MySQL Shell

  • Now that we have installed the MySQL Server, we need to make sure we can initialize the MySQL command line prompt (or MySQL Shell).
  • To open the MySQL shell, click on the “Windows” key and the “R” key at the same time. This will bring up a Run dialog window. Enter “cmd” in the input and click OK. This will open your Windows command prompt.

In a dialog window labeled "Run", "cmd" has been entered in the text box next to the word "Open".

  • Use the cd command to navigate to a directory where you’ll be working; for example, one of your project folders.
  • Once in the directory, enter the following command to initialize the MySQL command line prompt:

    mysql -u root -p
  • This tells the MySQL shell that you want to log in with the root user (-u). The -p stands for “password.” You will need to enter your MySQL password.

In the command line, the login command has been entered, and the user is prompted to enter a password.

  • If you see the MySQL command line prompt mysql>, everything is working correctly.

In the command line, the user is greeted with a welcome message to the MySQL shell.

  • Type quit to exit the MySQL command line prompt.

Note: You can also access the MySQL shell directly in VS Code! Depending on how you set up Git Bash, this may already be available to you. Select Terminal from your menu at the top of the screen and click on New Terminal in the drop-down menu.

New Terminal is highlighted at the top of the Terminal drop-down menu in VS Code.

  • If a terminal pops up at the bottom of your screen with cmd, powershell, or bash selected, you’re good to go. You can click on this drop-down to choose the integrated terminal of your choice.

`bash` is highlighted in a drop-down menu in a terminal at the bottom of the VS Code screen.

  • If you can’t access an integrated terminal and you’d like to, see the VS Code docs on the integrated terminal.
  • Once you verify that the MySQL Shell can be initialized correctly, move onto installing MySQL Workbench below.

MySQL Workbench Installation Guide

  • Navigate to the MySQL Community Downloads page for the MySQL Workbench.
  • Select Microsoft Windows from the Operating System dropdown menu.
  • Scroll down and in “Other Downloads”, find Windows (x86, 64-bit), MSI Installer and click “Download”.

MySQL Workbench Win

  • When prompted about signing up for a free Oracle Web Account, click “No thanks, just start my download.”
  • After the installer has downloaded, open it to begin the installation process.

© 2020