0

I'm unable to connect to my own server, which has a MySQL database which I want to access. I correctly opened the 3306 port on the router and called my internet provider that confirmed so. But when I try telnet x.xxx.xxx.x 3306 it stucks on

Trying x.xxx.xxx.x...

Same with traceroute command, the route seems to go till my PC and then find some blockage and it's unable to reach it.

I checked if there is some firewall, but as far as I am aware there aren't.

If I run on my server telnet localhost 3306 it correctly connects.

6
  • On your server you have probably started firewall. Enable your IP in firewall and try again. Commented Aug 2, 2023 at 11:08
  • is your public IP address between 100.64.0.0 and 100.127.255.255 by any chance? (doesn't look like it with that x.xxx.xxx.x pattern ... but have to ask anyway) ... what does correctly opened the 3306 port mean? what does "opened" mean? Commented Aug 2, 2023 at 11:28
  • @RomeoNinov How can I check if there is some firewall? I'm mounting linux mint and using ufw status it gives me State: Inactive Commented Aug 2, 2023 at 14:44
  • @JaromandaX No it is between thos IP addresses. I forwarded the port 3306 on my router, and like I said also my internet provider told me that the port is opened correctly. Commented Aug 2, 2023 at 14:46
  • Oh wait - are you trying to connect to public x.x.x.x:3306 from within your LAN? If so, perhaps you've port forwarded, but have you hair-pinned (assuming your router is capable) Commented Aug 2, 2023 at 23:28

1 Answer 1

1

you should check if your mysql server instance is listening on your machine ip address and not just on your localhost (127.0.0.1).

you can verify it in two ways:

  1. search in your mysql configuration bind-address option ( on many distro it /etc/mysql/mysql.conf.d/mysqld.cnf ) since by default mysql daemon bind itself on 127.0.0.1 and so it's not reaceable outside your machine.
  2. use a command like ss -pl |grep 3306 in order to check on which ip your mysql instace is binded to.
1
  • I already changed bind-address from 127.0.0.1 to 0.0.0.0 But when I use telnet I can see the problem is before mysql. There is something the blocks the connection before. Commented Aug 2, 2023 at 14:41

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.