渊渊其渊

 

关于Unable to connect to any of the specified MySQL hosts 的一种解决方法

用.net访问MySQL的有些时候,打开数据库时出现Unable to connect to any of the specified MySQL hosts的错误提示。

笔者经过检查,发现其中一种原因,在已经排除防火墙端口问题的时候,可以检查是否连接字符串中为此种写法:

server=localhost:3306

如果直接在server处带上了端口号,可能引起此类型错误。

解决方法:

server=localhost;port=3306;将端口后单独写出来即可。

posted on 2011-11-04 09:57  渊渊其渊  阅读(21930)  评论(1)    收藏  举报

导航