无法连接到任何指定的MySQL主机. [英] Unable to connect to any of the specified MySQL hosts.
本文介绍了无法连接到任何指定的MySQL主机.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
专家,
我必须通过asp.net应用程序连接mysql数据库.
但是我的网站在基于Linux的服务器上.
我的数据库位于另一台基于Linux的服务器phpmyadmin上.
当我尝试连接它时,它给了我如下所示的异常.
Hi Expert,
I have to connect mysql database through asp.net application.
But my website is on linux based server.
my database is on another server phpmyadmin which is not linux based.
when i try to connect it it gives me exception like following.
Unable to connect to any of the specified MySQL hosts. at MySql.Data.MySqlClient.NativeDriver.Open () [0x00000] in :0 at MySql.Data.MySqlClient.Driver.Create (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) [0x00000] in :0 at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection () [0x00000] in :0 at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection () [0x00000] in :0 at MySql.Data.MySqlClient.MySqlPool.GetConnection () [0x00000] in :0
但是当我在本地运行它时,对我来说效果很好.
我的连接字符串也正确.
请帮我解决这个问题.
预先感谢.
but when i run it locally it working fine for me.
my connection string is also right.
Please help me to solve this problem.
Thanks in advance.
推荐答案
您的MySql可能配置为仅侦听本地主机,请阅读以下内容:
http://www.razorsql.com/docs/support_mysql_local.html [ http://www.linuxquestions .org/questions/linux-newbie-8/connecting-to-a-mysql-server-not-on-localhost-568746/ [
Your MySql might be configured to listen to only the local host, read the following :
http://www.razorsql.com/docs/support_mysql_local.html[^]
http://www.linuxquestions.org/questions/linux-newbie-8/connecting-to-a-mysql-server-not-on-localhost-568746/[^]
这篇关于无法连接到任何指定的MySQL主机.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文