Docker-compose for MySQL with phpMyAdmin

Docker-compose for MySQL with phpMyAdmin

How do I create MySQL Docker container with phpMyAdmin. In this tutorial, you will learn to launch MySQL Docker containers along with phpMyAdmin docker container using docker-compose command.

Docker-compose is an useful utility for managing multi-container docker applications. In our previous tutorial, I had discussed about the keep persistent data of MySQL docker containers using Docker volumes. Once you launched a MySQL container can be connect via terminal directly. But the phpMyAdmin lovers may need the web interface for managing databases.

In this tutorial, you will learn to launch MySQL Docker containers along with phpMyAdmin docker container using docker-compose command.

Prerequisites

This guide assumes that you have already done the followings:

  1. You have installed Docker service on your System
  2. Also, have configured docker-compose utility on your system

How to Create MySQL with phpMyAdmin Docker Container

phpMyAdmin is an most popular web application for managing MySQL database servers. In this tutorial, we just use an example of Docker container for MySQL and phpMyAdmin.

So first create a docker-compose.yml file on your system with the following content.

docker-compose.yml:

version: '3'

services:
  db:
    image: mysql:5.7
    container_name: db
    environment:
      MYSQL_ROOT_PASSWORD: my_secret_password
      MYSQL_DATABASE: app_db
      MYSQL_USER: db_user
      MYSQL_PASSWORD: db_user_pass
    ports:
      - "6033:3306"
    volumes:
      - dbdata:/var/lib/mysql
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: pma
    links:
      - db
    environment:
      PMA_HOST: db
      PMA_PORT: 3306
      PMA_ARBITRARY: 1
    restart: always
    ports:
      - 8081:80
volumes:
  dbdata:

Save you file and close it.

general articles docker docker-compose mysql phpmyadmin

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Best MySQL DigitalOcean Performance – ScaleGrid vs. DigitalOcean Managed Databases

Compare ScaleGrid MySQL vs. DigitalOcean Managed Databases - See which offers the best MySQL throughput, latency, and pricing on DigitalOcean across workloads.

How to Run MySQL and phpMyAdmin using Docker

MySQL administration made easy with Docker. In this tutorial, you’ll learn how to connect phpMyAdmin to a MySQL server using Docker. This method will save you time and effort since you don’t have to install or configure phpMyAdmin and MySQL.

Install MySQL with PhpMyAdmin using Docker

Quickly install MySQL and phpMyAdmin using Docker without bloating your machine. Spin up and bring everything down with just a single command.

Docker Explained: Docker Architecture | Docker Registries

Following the second video about Docker basics, in this video, I explain Docker architecture and explain the different building blocks of the docker engine; docker client, API, Docker Daemon. I also explain what a docker registry is and I finish the video with a demo explaining and illustrating how to use Docker hub.

Setting up NodeJS with MongoDB using Docker and Docker Compose

Setting up NodeJS with MongoDB using Docker and Docker Compose - Learn about Docker and how to spin up a Docker orchestration for your development environment so, that way, you don't have to install MongoDB, you can just r...