set up phpmyadmin with docker

 

Set up phpmyadmin using docker

Quick set up PHPMyAdmin

 

https://migueldoctor.medium.com/run-mysql-phpmyadmin-locally-in-3-steps-using-docker-74eb735fa1fc

command to run docker:

sudo docker run --name phpmyadmin -d --link mysql:db -p 8081:80 phpmyadmin/phpmyadmin

 

Want PHPMyAdmin link to remote SQL

we try to use PHPMyAdmin to connect to AWS RDB

https://hub.docker.com/r/phpmyadmin/phpmyadmin/

https://docs.phpmyadmin.net/en/latest/setup.html#installing-using-docker

 

add local PHPMyAdmin config: /some/local/path/config.user.inc.php

<?php
/* Override Servers array */
$cfg['Servers'] = [
    1 => [
        'auth_type' => 'cookie',
        'host' => 'ieod-djc-eu-db-test.c11mugbhx7p5.eu-west-1.rds.amazonaws.com',
        'port' => 3306,
        'verbose' => 'ieod-djc-eu-db-test',
    ]
];

  

command to restart Phpmyadmin with volume link back to the local config file:

sudo docker run --name phpmyadmin -d --link mysql:db -p 8081:80 -v /etc/phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php phpmyadmin/phpmyadmin

 

posted @ 2021-05-24 15:44  若愚Shawn  阅读(62)  评论(0编辑  收藏  举报