Lesson Weekend

MySQL is a type of database software used to create, edit, query, and manage SQL data.

Follow the installation instructions below. We're going to installing two programs: MySQL Community Server and MySQL Workbench.

MacOS


MySQL Commuity Server

Start by downloading the MySQL Community Server .dmg file from the MySQL Community Server page. Click the download icon. Use the No thanks, just start my download link.

Next, follow along with the Installer until you reach the Configuration page. Once you've reached Configuration, select or set the following options (use default if not specified):

  • Use Legacy Password Encryption.
  • Set password to epicodus. You can use your own password if you want but epicodus will be assumed in the lessons.
  • Click Finish.

Configure Your Shell's Environment Variables

Next, configure your shell environement variables to know where to locate the MySQL Community Server. Open the command line and enter the following command:

For bash users:

$ echo 'export PATH="/usr/local/mysql/bin:$PATH"' >> ~/.bash_profile

For zsh users:

$ echo 'export PATH="/usr/local/mysql/bin:$PATH"' >> ~/.zshrc

Confirm That MySQL Community Server Is Working

Restart your shell (GitBash or Terminal) to apply the changes you've made to your shell's environment variables. Alternatively, you can refresh your shell by typing in the following command:

For bash:

$ source ~/.bash_profile

For zsh: bash $ source ~/.zshrc

Next, verify MySQL installation by opening terminal and entering this command:

$ mysql -uroot -pepicodus

You'll know it's working and connected if you gain access and see the MySQL command line. There will be an intro message, and the command prompt should look like this:

mysql> 

If it's not working, you'll likely get a mysql: command not found error.

You can exit the mysql program by entering exit.

MySQL Workbench

Next, download the MySQL Workbench .dmg file from the MySQL Workbench page. (Use the No thanks, just start my download link.)

Install MySQL Workbench to Applications folder. Open MySQL Workbench from within the Applications file.

Once opened, select the Local instance 3306 server. You will need to enter the password you set. (We used epicodus.) If it connects, you're all set!

Windows 10


MySQL Web Installer

Start by downloading the MySQL Web Installer from the MySQL Downloads page. This will allow you to install both the MySQL Community Server and the MySQL Workbench

Install the Programs

Follow along with the installer:

  • Click "Yes" if prompted to update.
  • Accept license terms.
  • Choose Custom setup type.
  • When prompted to Select Products and Features, choose the following:
    • Check the box that says "Enable the Select Features page to customize product features".
    • MySQL Server 8.0.19 (This will be under "MySQL Servers > MySQL Server > MySQL Server 8.0")
    • MySQL Workbench 8.0.19 (This will be under "Applications > MySQL Workbench > MySQL Workbench 8.0")
    • Note: you can choose to use the most recent versions of both programs instead of what's listed above.
  • Select "Next", then "Execute". Wait for download and installation. (This can take a few minutes.)
  • Advance through Configuration as follows:
    • High Availability set to "Standalone".
    • "Defaults are OK" under Type and Networking.
    • Authentication Method set to Use Legacy Authentication Method.
    • Set password to epicodus. You can use your own if you want but epicodus will be assumed in the lessons.
    • Defaults are OK under Windows Service. Make sure that checkboxes are checked for the options "Configure MySQL Server as a Windows Service" and "Start the MySQL Server at System Startup". Under Run Windows Service as..., the "Standard System Account" should be selected.
  • Complete Installation process.

Configure Your System Environment Variables

Next, add the MySQL environment variable to the System PATH. We must include MySQL in the System Environment Path Variable. This is its own multi-step process:

  • Open the Control Panel and visit System and "Security > System". Select "Change Settings" and a pop-up window will display. Select the tab "Advanced" and select the "Environment Variables" button.
  • Within the System Variables navigator window, select PATH..., click Edit..., and then New.
  • Add the exact location of your MySQL installation, and click OK. This location is likely C:\Program Files\MySQL\MySQL Server 8.0\bin, but may differ depending on your specific installation.

Confirm That Both Programs Are Working

Next, verify the MySQL Community Server installation by opening Windows PowerShell and entering this command:

$ mysql -uroot -pepicodus

You'll know it's working and connected if you gain access and see the MySQL command line. There will be an intro message, and the command prompt should look like this:

mysql> 

You can exit the mysql program by entering exit.

Finally, open MySQL Workbench and select the Local instance 3306 server. You will need to enter the password you set. (We used epicodus.) If it connects, you're all set.

Lesson 4 of 5
Last updated October 12, 2021