How do I connect to a remote MySQL database on the same router in Visual Studio 2008 using C#?
Question by painnpower20: How do I connect to a remote MySQL database on the same router in Visual Studio 2008 using C#?
I’m creating a web application in Visual Studio 2008 using C#. I also have an Ubuntu linux server setup with MySQL. I have added the database to the linux MySQL server. However, I can’t connect to it on my local pc. I’ve tried clicking the add connection button in server explorer (I’m using the MySql connector) and keep getting the error: ‘Unable to connect to any of the specified MySQL hosts.’
I was able to connect to a remote mysql server on 127.0.0.1
On the linux server, I modified the ‘bind-address’ to the IP address of the linux machine: 192.168.0.190
I’m also using MySQL workbench 5.2.16 and can’t connect to the linux server in there either. However, when I enter my local pc’s IP address, 192.168..0.194, it recognizes my pc.
I don’t know what I’m missing or doing wrong that I can’t connect. I can easily connect to a local database, but I want to use one on my linux server.
Thanks in advance!
Best answer:
Answer by Ratchetr
Did you install a firewall on the Ubuntu server? That may be blocking the connection.
From the Windows box, you could try telnet 192.168.0.190:3306 If that fails to connect, then something is blocking the connection at the TCP/IP level.
You did restart MySQL after changing the bind-address, right?
Give your answer to this question below!

















