1

I'm trying to set up a MySQL database to use it externally. I have a Ubuntu server with Plesk and Docker.

The main problem is that when logged in the server the port seems to be used/open, but externally it doesn't.

MySQL container settings

When I try to log in locally there's no problem, as it shows the port 6991 as open.


root@server:/# nmap -p 6990-6992 localhost
Starting Nmap 7.80 ( https://nmap.org ) at 2023-10-13 09:37 UTC
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000034s latency).
rDNS record for 127.0.0.1: localhost.localdomain

PORT     STATE  SERVICE
6990/tcp open   unknown
6991/tcp open   unknown
6992/tcp closed unknown

Nmap done: 1 IP address (1 host up) scanned in 0.11 seconds

When I execute the same nmap from an external machine:

user2@server2:/# nmap -p 6990-6992 [public ip]
Starting Nmap 7.80 ( https://nmap.org ) at 2023-10-13 09:45 UTC
Nmap scan report for [URL] ([public ip])
Host is up (0.000085s latency).
Other addresses for [URL] (not scanned):

PORT     STATE  SERVICE
6990/tcp closed unknown
6991/tcp closed unknown
6992/tcp closed unknown

Nmap done: 1 IP address (1 host up) scanned in 0.14 seconds

The firewall ports 6991 and 6990 of the server vendor are open too.

I've tried to check the ports to start a simple python http server and this works.

root@server:/# docker stop mysql
mysql
root@server:/# python3 -m http.server 6991
Serving HTTP on 0.0.0.0 port 6991 (http://0.0.0.0:6991/) ...

user2@server2:/# nmap -p 6991 [public ip]
Starting Nmap 7.94 ( https://nmap.org ) at 2023-10-13 11:52 UTC
Nmap scan report for [URL] ([public ip])
Host is up (0.020s latency).

PORT     STATE SERVICE
6991/tcp open  unknown

Nmap done: 1 IP address (1 host up) scanned in 0.36 seconds

Maybe some Plesk magic is blocking the port?

I've also tried to set MYSQL_TCP_PORT directly to 6991 but Docker doesn't expose this port. I can't redirect with Plesk interface.

1
  • Post the result of "netstat -ant" and "docker ps -a" on the server that your mysql docker is hosted, it seems a nat issue to me.
    – R1w
    Commented Oct 13, 2023 at 21:27

1 Answer 1

2

I was facing exactly the same problems and it was driving me crazy. Thank you for posting this, otherwise I would still be searching. I was suspecting a problem with our hardware firewall, but it was a plesk update in mid september, which I did not notice until I read the changelog. A bit of further research then made me stumble upon the solution:

Update your plesk to the latest version. If you already did and this did not fix it, try this:

  1. Login to your server via ssh.
  2. Remove that line {"ip":"127.0.0.1"} from /etc/docker/daemon.json
  3. Restart docker systemctl restart docker
  4. Restart the container docker container restart ContainerID

https://support.plesk.com/hc/en-us/articles/17895328139671

1
  • I should ask or check changelog before. By april this container was working. Thanks!
    – 5n10m
    Commented Oct 17, 2023 at 7:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .