Getting started with MySQL


slug: "getting-started-with-mysql" Want to learn how to use MySQL? This post will share how to get started with the basics!

Before You Start

Getting started

First off, most Mac computers do not come with MySQL installed, so we actually need to install it on our computer. So let's start with that.


Install MySQL

  1. We are going to be using **Homebrew** to help us with the installation. If you do not already use it, I would recommend learning about it and discovering how powerful it is.

  2. Let's open up the terminal and paste the line below to install Homebrew:

    /usr/bin/ruby -e "$(curl -fsSL"

  3. Note, you may need to close and restart your terminal for this next step, but let's make sure it works by typing in:

    brew info mysql

  4. Hopefully that works successfully! If it does, you should see something like below:

    mysql: stable 5.7.20 (bottled), devel 8.0.3-rc Open source relational database management system

  5. Now to install MySQL, all we need to do is:

  6. Congratulations! That was a quick and easy way to install MySQL! However, for those keen eyed out there, you will see in the output from the previous command that there are some recommended steps for us to take.

  7. If you would like to make your MySQL connection more secure on your computer, you can run mysql_secure_installation. This will ask you to change the root password for MySQL because when it originally installed, it did not supply one. That is up to you!

  8. Lastly, you will see at the bottom of the output these lines:

  9. To have launchd start mysql now and restart at login: brew services start mysql Or, if you don't want/need a background service you can just run: mysql.server start

Above it states you can either have MySQL running all the time or start it only when you need it. I personally use MySQL more often than not, so I ran brew services start mysql. If you don't use it as much, mysql.server start works just as well - just make sure to remember to start it each time you need it!

Install SequelPro

One of my favorite admin tools to work with MySQL. Visit **** to download.

Setting up SequelPro and MySQL

Now that we have SequelPro installed and MySql running (from mysql.server start), we can connect!

  1. Go ahead and open up SequelPro on your computer.
  2. You should be on a screen where in the top middle is says "Enter connection details below, or choose a favorite" - we are going to go ahead and enter connection details.
  3. In the input boxes in the middle, make sure "Standard" is select. Then you can input the follow:
  4. Host:
  5. Username: root
  6. If you entered a password, put that in the next field.
  7. Go ahead and click "Connect" and you should be connected!

Working with SequelPro

Now that we are connected, we could start working with some data! For this next part of the tutorial, we are going to use some dummy data.

  1. Head one over to ****, change the "Format" to SQL and also check "include create table". Click "Download Data" but also make note of the "Table Name" - it is mostly likely "MOCK_DATA"
  2. Head back to SequelPro and go to Database->Add Database
  3. In the Database Name field, make sure you have the same name as from - most likely "MOCK_DATA". When you have confirmed that, click "Add"
  4. Next up, go to File->Import
  5. Find the file you downloaded in step 1 from Mockaroo and click "Open"
  6. After it has imported, you should see on the left hand side under "Tables" your table of "Mock Data".
  7. If you click on the "Content" tab in the top of SequelPro, you should be able to see all the data within the MOCK_DATA table.

Congratulations you have successfully setup and installed MySQL!

More tips:

Have any more questions? Let me know on **Twitter @kevinguebert**!

© Kevin Guebert.RSS