Member-only story
Run MySQL & phpMyAdmin locally in 3 steps using Docker
Installing a relational database with a web based management tool is a very common requirement for a wide range of software projects. Not too many years ago, developers needed to download and install these components manually into our local machines in order to be able to work. However, thanks to container based technologies like docker, we can get our environment up and running in 3 simple steps.
Note: This article can be found adapted for other Database Management Systems on the following links:
Environment
This step by step tutorial is written based on the following requirements:
- Operating System: Mac OS Catalina 10.15.7
- Docker Community: v.20.10.7 for Mac (how to install docker)
Objectives
This tutorial aims to get up and running a fully functional platform with MySQL Community Edition + phpMyAdmin working on your local machine with the help of docker. Let's briefly describe these elements.
MySQL Community Edition is a freely downloadable version of the world’s most popular open source database that is supported by an active community of open source developers and enthusiasts.
PhpMyAdmin is a free software tool written in PHP aims to provide an easy to use Web based interface to manage a wide range of operations on MySQL and MariaDB databases. Daily work operations like managing databases, tables, columns, relations, indexes, users, permissions can be performed via the user interface without missing the ability of executing any SQL statement.
Docker is a software platform designed to make it easier to create, deploy, and run applications by using containers. It allows developers to package up an application with all the parts it needs in a container, and then ship it out as one package.
Step 1: Obtaining and running MySQL docker container
Using docker allows us to get and run containers to execute a wide range of software packages, so a very popular software like MySQL, is not an exception.
Visit Docker Hub to find and download docker images including a countless list of software packages.