PHPMyAdmin (MySQL Client)

Introduction

PHPMyAdmin is a web-based MySQL client that allows you to manage MySQL databases.

Run Using Containers

Container Introduction

In this example we'll use Docker containers to run a containerized version of PHPMyAdmin. Parts of this guide were taken from Dr. Yuste's How-to on Medium. A lot of this guide can easily be adapted for podman.

Pull the Docker Image

docker pull phpmyadmin/phpmyadmin:latest

Run the Docker Container

docker run \
--name phpmyadmin \
--network network_name \
-p 8888:80 \
-d phpmyadmin/phpmyadmin

This sets up a container named phpmyadmin on the network_name network, and maps port 8888 on the host to port 80 on the container. It's also possible to use Docker network links to connect the container to a MySQL container.

docker run \
--name phpmyadmin \
--link mysql_container_name:db \
-p 8888:80 \
-d phpmyadmin/phpmyadmin

Alternative Docker Run (No Network Link)

This procedure is taken from Maxim Orlov's dev.to post. First create a MySQL container of name mysql, root password root and detach it.

# MySQL Container
docker run \
--name mysql \
--env MYSQL_ROOT_PASSWORD=root \
--detach \
mysql:latest

Then create a PHPMyAdmin container, we'll explain the parameters afterwards.

# Start PHPMyAdmin Container
docker run \
--name phpmyadmin \
--publish 8888:80 \
--network some-net \
--env PMA_HOST=mysql \
--env PMA_PORT=3306 \
--env PMA_USER=root \
--env PMA_PASSWORD=root \
--detach \
phpmyadmin/phpmyadmin:latest

Access the Container

Once the container is running, you can access it by navigating to http://localhost:8888 in your browser.

References

Web Links

Note Links