Kitematic is the GUI based tool for management of Docker containers on Mac or windows. It's primarily focused for developers who are more interested in creating and using Docker containers rather than remembering the CLIS commands.
In this blog we will learn about setting up containerised MySQL database instance on Mac using Kitematic.
Setup Docker & Kitematic:
Create free Docker Hub account by visiting this link. This will help in easily searching and downloading docker images from Docker Hub. For those who don't know Docker Hub is the library and community for container images managed by Docker Inc.
Install Docker Desktop depending on your operating system. Use this link for Windows and this for Mac. We will be using Mac in rest of this blog but steps for windows will be similar (if not exactly same). Installation instructions are given on the setup download page itself for both Mac and Windows.
Install Kitematic depending on your operating system. Use this link to download the setup zip file. To install just unzip the file, double click the setup file and follow the setup instruction of the setup exe.
Once Docker is installed click the Docker icon in applications and you will see Whale in menu bar like following image:
Click on the Whale Icon and click on Sign In/Create Docker ID option as shown in following screenshot.
It will open following screen, enter your Docker Hub credentials and click on Sign In button.
Once successfully logged In you will can see your user ID in place of Sign In/Create Docker ID in the Docker menu like following screenshot.
To Open Kitematic click on Kitematic Icon in applications and you will get following screen:Here on left top you will see your Docker Hub user ID which Kitematic will automatically pic from Docker Desktop. On left side you will see all the containers you have and on right you will see list of container Images from Docker Hub.
Setup MySQL Server on Containers:
To setup MySQL use following steps:
Make sure that Docker for Desktop is running and open Kitematic and search for MySQL on the search window, which will show the official MySQL image as shown in following screenshot:
Once you click on Create button to start the installation, Kitematic will show following screen:
Once installation is complete you will get following screen. As shown in the log message of above screenshot, the server will not start until we set the root password of the server. As we are doing this setup for local development we will allow empty root password for the server.
To set Empty root password, click on Settings Tab and set MYSQL_ALLOW_EMPTY_PASSWORD as true in environment variables as shown in below screenshot.
Now Click on Start button to start the server.Once server is started you will be able to see the Running status and Stop button like below screenshot.
Now the MySQL server is ready to connect, So click on Hostnames/Ports sub-tab under Settings tab and note the port number as highlighted in below screen.
Open MySQL Workbench which is the GUI for managing MySQL databases (you can download that from here). Once opened you will get following home screen.Click on + icon as highlighted in above screenshot.
On clicking + icon, you will get following screen where you have to give the Connection Name, Host Name, Port Number (taken from Step 6 ) as shown in below screenshot and click Test Connection.
If the connection is successful you will following screen mentioning connection is successful.
Once click Ok on this screen and create connection screen you will see the connection listed on Home of My WorkBench like below screenshot.
Once you click on the connection shown on previous step, you will be connected to MySQL database and get following screen where you can do all database management operations.
This is how we can setup containerised MySQL on Mac or windows (steps will be exactly similar) using Docker Desktop and Kitematic.
S Ravi Kumar
Ravi is an experienced IT professional with over 15 years of IT services experience using Microsoft technologies including like ASP.Net, C#, .Net Core, Xamarin.Forms, Azure etc.