asp.net 连接 Mysql
<add name="MySQLConnString" connectionString="server=localhost; user id=root; password=sa; database=qf_shop" providerName="MySql.Data.MySqlClient"/>
以上的是本地的,很正常<add name="MySQLConnString" connectionString="server=mysql0.100ws.com; user id=lonbia_qfdb; password=123; database=lonbia_qfdb" providerName="MySql.Data.MySqlClient"/>以上的代码是远程的,报错是:
[Exception: 引发类型为“System.Exception”的异常。]
MySql.Data.MySqlClient.NativeDriver.Open() +110[MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.]
Dtsc.Common.Utility.MySQLHelper.ExecuteReader(CommandType cmdType, String cmdText, MySqlParameter[] commandParameters) in E:\workspace\千芳\QianFang\ACL-UTILITY\Dtsc.Common.Utility\Helper\MySQLHelper.cs:163
.............连不上主机...请指教,小弟先谢了
<add name="MySQLConnString" connectionString="server=localhost; user id=root; password=sa; database=qf_shop" providerName="MySql.Data.MySqlClient"/>
以上的是本地的,很正常<add name="MySQLConnString" connectionString="server=mysql0.100ws.com; user id=lonbia_qfdb; password=123; database=lonbia_qfdb" providerName="MySql.Data.MySqlClient"/>以上的代码是远程的,报错是:
[Exception: 引发类型为“System.Exception”的异常。]
MySql.Data.MySqlClient.NativeDriver.Open() +110[MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.]
Dtsc.Common.Utility.MySQLHelper.ExecuteReader(CommandType cmdType, String cmdText, MySqlParameter[] commandParameters) in E:\workspace\千芳\QianFang\ACL-UTILITY\Dtsc.Common.Utility\Helper\MySQLHelper.cs:163
.............连不上主机...请指教,小弟先谢了
解决方案 »
- 在 ASP.NET 使用 jQuery BlockUI 插件 提示对象不支持此属性或方法
- 一个程序只对应一个域名,有什么好的解决方案吗?
- 请问关于用sqldatasource时编程传入参数的问题
- 做一个项目的时候要画一个图有"菱形,正方形"的这个图叫做什么?
- asp.net中怎么实现checkbox 多选并且传值到另外一个页面 ?
- 关于Ajax返回多个值
- 如何将网页传递的参数加密?
- asp.net需要的windows操作系统环境是什么
- Unable to open connection to "Oracle ,Microsoft provider V2.0.50727.42".
- MVC3.0 ajax无刷新分页
- ASP.NET动态页面静态化后的跳转问题
- 100分求问题答案。
MySql.Data.MySqlClient dll
3306应该打开了.
MySql.Data.MySqlClient dll这个也引用了.
异常详细信息: System.Net.Sockets.SocketException: 不知道这样的主机。
意思是连不上数据库啊
server=mysql0.100ws.com;换成服务器IP呢
还是不行哟.
<add key="Connection" value="Server=127.0.0.1;User ID=root;Password=;Database=box;CharSet=gb2312;"/>
</appSettings>
我通常这样写
加了这个.就行了.楼上的.太感谢了/