Getting Ready to Code
In order to start using MySQL, we need to first download and install two applications: MySQL Server and My SQL Workbench.
Note that the instructions provided below are accurate as of March 2024. MySQL may update its download links or alter installation procedures in the future. In such cases, you can typically find the most up-to-date installation guides on YouTube by searching for terms like "Installing MySQL on Windows" or "Installing MySQL on Mac" and selecting the latest video with the highest number of views.
For the time being, let's proceed with installing the latest version of MySQL.
Installing MySQL applications
Windows
For Windows users, go to https://dev.mysql.com/downloads/installer/.
Scroll down and click on the second “Download” button to download the application. You’ll be directed to another page. Scroll to the bottom of the page and click on “No thanks, just start my download.”
Once you have downloaded the program, double-click on the file and follow the instructions to install the software. When prompted for administrative permissions, click “Yes” to grant the necessary permissions.
Next, you will be prompted to choose a setup type, select “Custom” and click “Next”.
You’ll be asked to select the products to install.
Under “Available Products”, fully expand “MySQL Servers” by clicking on the + signs. Once fully expanded, select the latest version (currently 8.0.36) and click on the green arrow to move this item to the “Products To Be Installed” section.
Next, scroll down and expand “Applications”. Fully expand “MySQL Workbench”, select the latest version, and click on the green arrow to move this item to the “Products To Be Installed” section.
Once you are done, click on “Next” and follow the instructions to continue with the installation. Stick to the default options selected at each stage.
When prompted to enter a password (MySQL Root Password), enter your desired password and jot down the password; you’ll need this password later.
Click on “Next” to continue and complete the installation.
Mac OS
For Mac users, to install MySQL Server, go to https://dev.mysql.com/downloads/mysql/.
Scroll down and click on the first “Download” button if your system uses an Apple silicon processor (such as the M1 or M2 chip) or the second “Download” button if it uses an Intel processor.
Once you do that, you’ll be directed to another page. Scroll to the bottom of the page and click on “No thanks, just start my download.”
Once you have downloaded the program, double-click on the file and follow the instructions to install the software. If you are asked for permission to continue, click on “Allow”, “Agree”, or provide your Macbook password when prompted to proceed.
At the configuration stage, choose “Use Strong Password Encryption” and click “Next”. Enter your desired password and jot down the password; you’ll need this password later. Ensure that the "Start MySQL Server once the installation is complete" option is selected and click on "Finish" to complete the installation.
Once you are done installing MySQL Server, you need to install another software known as MySQL Workbench. This software provides us with a graphical user interface to make it easier for us to interact with MySQL. To download MySQL Workbench, go to https://dev.mysql.com/downloads/workbench/.
Click on the appropriate “Download” button (depending on the processor that your Macbook uses) to download the application. Once again, you’ll be directed to another page. Scroll to the bottom of the page and click on “No thanks, just start my download.” to download the program. Double-click on the downloaded file and follow the instructions to install it after downloading.
Launching MySQL Workbench
Once you have installed the necessary applications, we are ready to do some coding.
First, launch MySQL Workbench, you’ll get the screen below:
Click on the grey rectangle under "MySQL Connections" and you’ll be prompted for a password. Enter the password that you keyed in previously when you installed MySQL Server and select “Save password in vault” (or “Save password in keychain” for Mac users). Next, press OK to proceed. If all goes well, you should be directed to a screen that looks like the one below:
The main area is a text editor where we’ll be entering our SQL commands. The window below is the output area (refer to the screenshot above).
There’s an additional panel on the right (labeled “SQLAdditions” in the screenshot above) that we do not need. You can close this panel by selecting View > Panels > Hide Secondary Sidebar in the top menu.