How to Install MySQL Workbench on a Mac
This lesson examines the steps necessary to install MySQL Workbench on a Mac, including how to add a connection to the local MySQL database.
Guide Tasks
  • Read Tutorial
  • Watch Guide Video
Video locked
This video is viewable to users with a Bottega Bootcamp license

Update

Disregard all of the sudo keywords, using sudo will throw an error. 
Use the rest of the command the same, remove sudo keyword. 

Update

MySQL Workbench 8.0.32 is causing issues on MacOS (as of 12/14/22)
When you download, either choose 8.0.33 (ARM for Apple chip, x86 for Intel) or later, 
or choose Archives > Product Version 8.0.31

In this guide, we're going to walk through how to download and configure the MySQL workbench system. Now MySQL workbench is a fantastic open-source tool that allows you to look right into your database. There are other ways of looking into your database. Technically your database is essentially a set of binary files on your system.

The system allows you to manage all your data, also you don't need a tool like MySQL workbench in order to access it. You could access MySQL via the command line. Usually, it's good to use some kind of graphical user interface and that's what MySQL workbench offers. It also has some very nice tools such as being able to model data and see how it relates to itself inside of the program.

Now the very first thing you're going to do if you do not have this already on your system is to download it and you'd go to dev.mysql.com/downloads/workbench/ and what we're going to do here is going to be pretty much the same whether you are on a Mac, PC, or a Linux machine. If you scroll down the MySQL page, releases gives you a full set of the operating systems that are available. Windows, MAC OS X, three different versions of Linux, and the source code itself.

Select what operating system you are using then simply click download. it's a decent-sized application you can see the installer is almost 100 megabytes. This may take a few minutes depending on your connection. You're going to download it, open it up, and just accept all of the default items at the installer. There is nothing that you have to do separately on that.

large

Spotlight search for MySQL workbench. Open up MySQL workbench and we're going to see how we can connect it to the system. If you do not have any type of connection, I want to walk through and show you exactly what steps you need to take. You can see it's going to be pretty straightforward.

Do you see where it says MySQL connections? First, let's verify that we have our database running. So if we open up the terminal you can see the last command I ran was to start up the MYSQL server. So technically this should already be working but I'm going to stop it and then start it back up.

Just so you can see that process, type clear into terminal, and then run mysql.server start (if this isn’t running already). This is going to start it back up and now we should be good to go. Opening up my sequel workbench again.

large

Click on the little plus sign right next to MySQL connections and it's going to open up a “set up new connection” dialog box. Give it a name. In this case, I'm going to call dev-camp-course and all of these other items are going to work exactly how they're working right now. Now to verify that everything is wired up. Just click on “test connection” and you can see it says successfully made the MySQL connection and it found out all of these items.

large

Hostname is whenever you see 127.0.0.1, this means it's mapping it to your local system, so this needs to be exact. 127.0.0.1 This is just your computer now. If you are connecting to an outside database you can use MySQL workbench to do that. So technically this hostname could be a side server IP address you'd provide it right here. You would also provide the port number, the username, and the password.

Then you could just create a connection to an outside service. It's a very popular thing to use this for but right now we're going to be doing all of this locally. So I'm just going to hit OK and as you can see we now have a MySQL connection called dev camp course. If you double click “dev-camp-course” this is going to open it up and this is where we're going to all of our work throughout this course.

If I Click on server status this shows us that the server status is running now. If you open this up at any time and you can see a little stop sign or a little red box here that says service status is not running. That means that you simply have to start up the MySQL server from the command line.

large

Right here you can see there are a number of different configuration items. Most of which you really never have to change but it's just good to know where they're located. The host, which is the local MacBook system, the socket, and the port. If you are familiar with how IP addresses work right here we have the local IP address essentially or what's mapped to it.

The port is our way of being able to access a specific entry point in the computer. Now, this is important for working locally but it becomes even more important when working with an outside server.

So for example, if I was connecting to an outside system and I was trying to perform some data management for that system, I'd need to know what port was opened up specifically for the database to connect to it. You can see some other things such as the version, compilation, where the configuration file is, and when this started running.

Then each one of these items is a set of various features that are turned on or are not available. We just need to have a performance schema and SSL availability. We can see those are working, they are error log is also turned on. So everything here is working nicely and as we go through the course we're going to examine how else we can work with the workbench.

Resources