Unable to connect to any of the specified MySQL hosts.
2024-10-19 06:35:17
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>
最新文章
- 【目录】Zookeeper目录
- OpenCV2:等间隔采样和局部均值的图像缩小
- iosTest
- Netty 4(一) zero copy
- JQuery:JQuery删除元素
- lintcode:在O(1)时间复杂度删除链表节点
- 【Spring】基于注解的实现SpringMVC+MySQL
- 本地Git仓库同步到Bitbucket 远程Git仓库
- SQL修改表字段,加附属属性
- PythonStudy——PyCharm使用技巧 Column Selection Mode(列选择模式)
- Java容器---字符容器StringBuffer &; StringBuilder
- Tengine(nginx) 搭建Tomcat集群
- Educational Codeforces Round 62 E 局部dp + 定义状态取消后效性
- 版本控制工具git
- Oracle 数据库 简单查询
- 大页内存(HugePages)
- ganglia安装 by frank
- node系列:全局与本地
- JSON.stringify和JSON.parse的使用
- Linux下hosts、host.conf、resolv.conf的区别
热门文章
- tar命令解压时如何去除目录结构及其解压到指定目录 (--strip-components N)
- PAT 1114 Family Property[并查集][难]
- 分页组件vue和jsp版本
- python openpyxl 封装Execl常用操作的方法
- Oozie的详细启动步骤(CDH版本的3节点集群)
- Python笔记 #09# Basic plots with matplotlib
- 20145105 《Java程序设计》第3周学习总结
- java实验五20145204
- 导入tensorflow:ImportError: libcublas.so.9.0: cannot open shared object file: No such file or director【转】
- Rest和WebService的区别