c#连接Mysql数据建立连接时提示:Unable to connect to any of the specified MySQL hosts.

出现此错误的原因是Server(数据库服务器IP地址填写错误)

当Server配置值是“(local)”或者是"(localhost)"时都会产生此错误,连接MSSQL时使用“(local)”是可以的,但连接MySQL是不行的,正确的方法是不使用小括号,例如下面的 app.config 文件中的配置:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<connectionStrings>
		<add name="Default" connectionString="server=localhost;uid=root;pwd=root;database=DreacomSpider" providerName="mysql" />

	</connectionStrings>
</configuration>

最新文章

  1. 【目录】Zookeeper目录
  2. OpenCV2:等间隔采样和局部均值的图像缩小
  3. iosTest
  4. Netty 4(一) zero copy
  5. JQuery:JQuery删除元素
  6. lintcode:在O(1)时间复杂度删除链表节点
  7. 【Spring】基于注解的实现SpringMVC+MySQL
  8. 本地Git仓库同步到Bitbucket 远程Git仓库
  9. SQL修改表字段,加附属属性
  10. PythonStudy——PyCharm使用技巧 Column Selection Mode(列选择模式)
  11. Java容器---字符容器StringBuffer &amp; StringBuilder
  12. Tengine(nginx) 搭建Tomcat集群
  13. Educational Codeforces Round 62 E 局部dp + 定义状态取消后效性
  14. 版本控制工具git
  15. Oracle 数据库 简单查询
  16. 大页内存(HugePages)
  17. ganglia安装 by frank
  18. node系列:全局与本地
  19. JSON.stringify和JSON.parse的使用
  20. Linux下hosts、host.conf、resolv.conf的区别

热门文章

  1. tar命令解压时如何去除目录结构及其解压到指定目录 (--strip-components N)
  2. PAT 1114 Family Property[并查集][难]
  3. 分页组件vue和jsp版本
  4. python openpyxl 封装Execl常用操作的方法
  5. Oozie的详细启动步骤(CDH版本的3节点集群)
  6. Python笔记 #09# Basic plots with matplotlib
  7. 20145105 《Java程序设计》第3周学习总结
  8. java实验五20145204
  9. 导入tensorflow:ImportError: libcublas.so.9.0: cannot open shared object file: No such file or director【转】
  10. Rest和WebService的区别