Why can't I telnet to mysql port 3306?

Linode Staff

I have configured in my.cnf and turned off the firewall but it doesn't work. I just created 3 VPS using CentOS 8, seems to have the same problem.

1 Reply

If you're trying to reach mysql over port 3306 from an external location, then yes, you'll need change the bind address in my.cnf, similar to what's outlined here:


Try to add bind-address = to your [mysqld] section of your my.cnf and restart mysqld.

I just tested this out and it worked successfully. You mentioned you did this, but just to confirm: Add bind-address =, like it mentions, and also comment out bind-address = by placing the # in front:


bind-address =
# bind-address          =

Then after restart mysql with sudo systemctl restart mysql, you should be able to telnet from an external server.

telnet 3306
Connected to 192-53-115-99.ip.linodeusercontent.com.
Escape character is '^]'.

nmap -Pn -p3306
Starting Nmap 7.92 ( https://nmap.org ) at 2021-11-26 12:36 EST
Nmap scan report for 192-53-115-99.ip.linodeusercontent.com (
Host is up (0.39s latency).

3306/tcp open  mysql

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


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct