Setting up MySQL
on Your Local Environment

In this exercise, we will be working towards getting your local workstation set up with a database that you can begin working with.

MySQL + Workbench

We will be using MySQL as the database of choice. This will allow us to store and retrieve data that the user can later interact with. MySQL Workbench is a desktop client that allows us to handle our data and much more. You should spend more time reviewing MySQL workbench and its capabilities! Also, please keep in the back of your head that there are different types of databases other than MySQL, but I will leave it to you for that exploration.

MySQL on your local workstation

Installing MySQL:

  • Visit this link to

  • Note: Click the "No thanks, just start my download." at the bottom of the screen

  • Once it has installed completely, navigate to System Preferences ==> MySQL, and make sure that your MySQL Server is running.

  • At this point, you should be able to connect to your local MySQL database by opening your terminal and performing:

    mysql -­h localhost -­u root

  • At this point, if you are getting any errors please reference this stackoverflow post! Simply, you will most likely need to run the following command:

    export PATH=${PATH}:/usr/local/mysql/bin

Installing MySQL Workbench:

Setting Up Our Local Workstation:

  • Launch MySQL workbench, to start setting up the connection to our local workstation, or frequently referenced as localhost.

  • Once connected create a new "schema" called "test". You have now created an empty database!

  • Next we need to create a user and provide them the proper credentials to interact with our newly created schema

    Go to the top menu: Server --> Users --> Privileges

  • Create a new user called "test" with the "Limit to Hosts Matching" field set to "localhost" and the password should be "test"

  • Click into the Administrative Roles and check the "DBA" box, which gives us all of the database administration privileges we may need

  • Click into the Schema Privileges tab and add an entry, which would be referencing our "test" schema.

  • Finally, lets click Select "ALL", which will give our user all access rights with the test schema

  • MAKE SURE TO CLICK APPLY! This will save all of our recent changes allowing us to now start playing with our local database.

Final Thoughts

You now have a local MySQL database set up! In an upcoming blog, I will explain how you can easily connect to this database via Loopback!