0
1
I can't connect to my remote MySQL server
UNABLE TO CONNECT TO ANY OF THE SPECIFIED MYSQL HOSTS
I did some tests and it works with localhost on the server.
My user has the privilege to connect from any host
and this is the network settings of the server
and I bind the address to 0.0.0.0
I'm trying to connect with visual studio with the MySQL connector, and I also tried with a connection string in C# (both works in local)
Also, the windows firewall allow MySQL default port for TCP and I forward 3306 to the server ip on the router(I don't know if that was necessary)
If I do telnet localhost 3306
on my server it works but if I do telnet 216.x.x.x 3306
from a remote computer it doesn't work. I rebooted the router and I forward the port to the server. is port forwarding is the only thing to do on the router?
Any ideas why it doesn't work?
Thank you
Hey Mac, have you flushed the privileges? You can get it done with the command below or even restarting the mysql server.
mysql> FLUSH PRIVILEGES; – None – 2013-04-15T02:15:23.333
Also, check with privileges your user has with the following command
SHOW GRANTS FOR usager;
You should be able to see something like that : GRANT ALL PRIVILEGES ON . TO 'usager'@'%' IDENTIFIED BY PASSWORD '*' WITH GRANT OPTION – None – 2013-04-15T02:18:59.440
Yes, it's what I got for this user and I have flushed the privileges. Still no luck :( – Marc – 2013-04-15T02:22:37.100
Make the bind-address "Unchecked" and restart the server. This line should actually be commented out in your my.cnf – None – 2013-04-15T02:26:05.090
Sorry, it doesn't work – Marc – 2013-04-15T02:31:19.250
Can you telnet it on port 3306? – None – 2013-04-15T02:54:51.473
oh no. It says Could not open connection to the host on port 3306. – Marc – 2013-04-15T03:01:38.300
Primarily make very sure that your port forwarding is active and that it is working correctly. Problems with this are so common it is ridiculous — the router, Windows firewall, perhaps extra local firewall must all play ball. Sometimes restarts are needed at the router, etc. My tip is to absolutely positively check that the port forwarding rules work before looking at other parts. – Daniel Andersson – 2013-04-15T09:09:07.950
I don't understand what is wrong. If I do telnet localhost 3306 on my server it works but if I do telnet 206.x.x.x from a remote computer it doesn't work. I rebooted the router and I forward the port to the server – Marc – 2013-04-15T14:09:35.080
@DanielAndersson you were right, can you post your answer so I can accept please – Marc – 2013-04-15T15:10:02.253
Alright, glad it worked! – Daniel Andersson – 2013-04-15T16:35:39.023