How can I connect local phpMyAdmin via SSH tunnel to a remote mySQL dockerized container (example.com)? This is the local phpMyadmin in docker compose:
pma:
image: phpmyadmin/phpmyadmin
container_name: pma
environment:
- PMA_ARBITRARY=1
- 'PMA_ABSOLUTE_URI=https://pma.local/'
volumes:
- './config.user.inc.php:/etc/phpmyadmin/config.user.inc.php'
restart: always
This is the custom configuration for PMA:
$cfg['Servers'][$i]['verbose'] = 'Localhost';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['compress'] = FALSE;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$i++;
$cfg['Servers'][$i]['verbose'] = 'Remote Server';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = '3307';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['compress'] = FALSE;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$i++;
Using Core Tunnel I've set this in my local machine:
This is my test container on example.com:
docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest
Now, if I input on PMA the following (after enabling the tunnel):
Server: 127.0.0.1
User: root
Password: my-secret-pw
I get a:
mysqli_real_connect(): (HY000/2002): Connection refused
I'm really a newbie on this and surely doing something very bad. Could you please give me some advices? Many thanks in advance.