连接mysql远程数据库C# [英] connecting mysql remote database c#

查看:269
本文介绍了连接mysql远程数据库C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我试图将mysql数据库连接到通过LAN连接的其他计算机.
mysqlconnection就是这样

Hi
I tried to connect to mysql database to other computer connected through LAN.
mysqlconnection is like that

MySqlConnection con = new MySqlConnection("server=192.168.30.102;database=LMMS;uid=root;");
con.open();



但这没用.它给出了无法连接到任何指定的MySQL主机的例外.
我正在针对MySQL和Windows 7和Visual Studio 2010使用xampp

请helppp .....:/



but it didn''t work. it give exception that "Unable to connect to any of the specified MySQL hosts.
I am using xampp for mysql and windows 7 and Visual studio 2010

please helppp..... :/

推荐答案

一个可能的原因是您的防火墙阻止了端口3306(默认的mysql端口).因此,请确保该端口可用于网络流量.
One possible reason is that your firewall is blocking port 3306 (default mysql port). So ensure that this port can be used for the network traffic.


这篇关于连接mysql远程数据库C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆