본문 바로가기
Synology/Docker(in Synology)

[Docker] MYSQL , PHPMYADMIN

by kage2k 2021. 6. 27.
728x90
반응형

Docker MYSQL , PHPMYADMIN

step 1. download the MYSQL repo using this command line:

docker pull mysql:lastet

Prepare a local folder on my NAS.
For example in '/volume1/docker/mysql'.

Start MYSQL container:

docker run -d \
--name some-mysql \
-v /volume1/docker/mysql:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=my-secret-pw \
-p 3306:3306 \
mysql:latest

You have to do port forwarding as necessary.

 

step 2 download the phpMyadmin repo using this command line:

docker pull phpmyadmin/phpmyadmin:latest

미리 mysql contanier ip 를 알아두어야 한다.
방법은 portainer에 접속 mysql container -> Connected networks 부분에서 확인 가능.

docker run -d \
--name phpmyadmin \
-p want_port:80 \ change the left value to a custom port if you wish/need to
-e PMA_PORT=same port as your MYSQL instance \ (3306 for example)
-e PMA_HOST=mysql container ip \
phpmyadmin/phpmyadmin:latest

 

728x90

 

step 3 phpMyadmin 네트워크 묶기

portainer 에 접속하여
phpMyadmin container -> Connected networks 에서
Mysql container 와 같은 network에 join a network를 한다.

이후 http://nasip:want_port 로 접속하면 사용이 가능하다.

 


 

End
⊙^⊙ Thank For Reading | Happy Coding ⊙-⊙

Setapp on Mac invite link flutterkage2k

The referrer gets a free month, up to a maximum of six months, for each friend who creates an account and signs in on their Mac.

Setapp_Logo.png

도움이 되셨다면, 커피 한잔 사주세요

buymeacoffee.png

300x250
반응형