Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

426
Visualizações
Can't Connect to the remote MYSQL server via 3306 port

I have been spending over 6 hours trying to solve this problem. After installing mysql server, I obviously changed bind-address from 127.0.0.1 to 0.0.0.0. I also tried commenting it out. When I check open port status with Nmap, it shows like below:

Nmap scan report for localhost (127.0.0.1)
Host is up (0.000011s latency).
Not shown: 997 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
23/tcp   open  telnet
3306/tcp open  mysql

so the 3306 port is definitely open. However, when I try to connect the server from my other machine, it shows:

ERROR 2003 (HY000): Can't connect to MySQL server on '49.247.XXX.XXX' (61)

so I check it with telnet and the result is:

telnet: connect to address 49.247.XXX.XXX: Connection refused
telnet: Unable to connect to remote host

so I go back to that server machine an check the status again with netstat and the result is like below:

❯ sudo netstat -tlpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      769/systemd-resolve
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      994/sshd
tcp6       0      0 :::22                   :::*                    LISTEN      994/sshd
tcp6       0      0 :::23                   :::*                    LISTEN      3355/xinetd
tcp6       0      0 :::3306                 :::*                    LISTEN      4108/mysqld

I find the number 3306 so it must be open right? I even tried the "sudo ufw allow XXXX/tcp" command to make sure 3306 is open. However, I ran out of ideas as to what is missing. Does anyone have any idea what to look for or how to fix this? Thanks a lot in advance!

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You need to also set the firewalld.

Install Firewalld and do the following:

 firewall-cmd --zone=public --add-port=3306/tcp \ --permanent

this will make sure 3306 is open and accepting.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda