It looks like weird happening, I've followed and fixed all the possible things but still MySQL
port 3306 is not accessible remotely.
Here's my setup:
Machine: Windows Server 2012 R2
MySQL Server: 8.xx
Settings have been applied:
my.ini
bind-address
did to 0.0.0.0 and and thus after exec command netstat -an
this is what I get TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING
3306
inbound/outbound both. and set that to allow edge traversal
as well%
all host and then provided permission to all databases as well. which has been checkedI guess these are the actions I took afterward. But this is not working at all.
When I'm trying to do telnet server_ip 3306
error: Connecting To server_ip ...Could not open a connection to the host, on port 3306: Connect failed
from other machines. The local host is working fine.
I don't see any other workaround that could else cause this issue?
I've tried installing MySQL 8.0 on my local PC:
Then I tried to connect from a remote Windows Server 2016 Standard using telnet local_ip port
through command-prompt and I received this:
J
8.0.27
ZPhqTaMC v|)64Pthmmysql_native_password
Which means the connection has been established. I test it further using SQLYog tool:
and for sure I can connect to it.
What I did next was I went to my firewall setting here
Control Panel\All Control Panel Items\Windows Defender Firewall\Allowed applications
and removed all related firewall exception that was made during the installation so I've removed the following:
mysqld
port3366 <-- this is the port I used
port33060
And when I tried to connect remotely, it tells me this:
Connecting To local_ip...
Could not open connection to the host, on port 3366: Connect failed
This confirms my suspicion that firewall have blocked the connection. Now, OP said that the port have been added to the firewall but still can't connect so my first step after that is adding back mysqld
into the firewall exception.
mysqld
from MySQL folder - usually found in C:\Program Files\MySQL\MySQL Server 8.0\bin
Once I've done that, I tried connecting and it's successful. Note that I did not re-add the ports that I've removed previously but I still can connect remotely. Also, I didn't add bind-address
in my.ini
setting.