2

Hi guys I have a situation where I need that my Web Application, hosted in some other machine, access my local MySql Server Instance. My string connection looks like

mysql://<user>:<password>@<my_ip>:3306/<data_base_name>

However when I try to connect I am getting the error:

Can't connect to MySQL server on '1**.***.**.*7' (111)

Searching a little bit I discovered that it could be due the configuration of bind-address in my.conf file. However in MySql 5.7 there is no need to do that once, when I run the select below I get this:

show variables like 'bind%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| bind_address  | *     |
+---------------+-------+

Searching a little bit more, I found that it could be due the firewall blocking connection on port 3306. Then I created an inbound and outbound rule for that, but I'm still getting this error and I can perfectly connect to my MySql Server locally.

Besides, I've already seen these posts:

  1. Can't connect to MySQL server error 111
  2. ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
  3. How to allow remote connection to mysql
  4. https://serverfault.com/questions/823877/mysql-connection-not-working-with-windows-firewall-on

However none of them solved my problem. Someone can help me out?

kizus
  • 47
  • 5
  • Any chance you are hosting your server in amazon? In that case you also need open the amazon ports – Juan Carlos Oropeza Sep 04 '18 at 15:45
  • I am hosting the MySql Server in my own machine. – kizus Sep 04 '18 at 16:51
  • So you are accesing your machine inside your own lan? just a different machine? – Juan Carlos Oropeza Sep 04 '18 at 18:32
  • No, my web Application is hosted in pythonanywhere, however, its mysql version is different of that I need. For that reason I thought in access my own local MySql Server from pythonanywhere. – kizus Sep 04 '18 at 18:43
  • Well that is my point. I'm not familiar with pythonanywhere. But my suggestion is you should try to access your Server first from your own PC (as you said you can), then from another PC inside your LAN, and then from outside your LAN. That way you try to isolate where the problem is. Connect to a server should be straight forward. So the most like it is something on the firewall, antivirus or router setups. – Juan Carlos Oropeza Sep 04 '18 at 18:48

0 Answers0