Mentioning Multiple servers in Connection String does not work with MySQL.Net Connector
Posted by: Anil Punnam
Date: October 25, 2017 11:56AM

We have 4 MySQL database servers replicating data round globe.
We have a .net application talking to databases on these servers. usually we mention one server name and talk to database on that server only.
But as per MySQL Support, we can mention more than one server name in connection string, so that if one server is not reachable, it connects to another server.

Below is my connection string in .Net
<add name="ConnZCAT" connectionString="Server=172.30.2.5,10.14.204.70; Uid=admin;Pwd=admin123;" providerName="MySql.Data.MySqlClient" />

But I am just getting below error

Server Error in '/' Application.

The requested name is valid, but no data of the requested type was found
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: The requested name is valid, but no data of the requested type was found

Source Error:

Line 216: catch (Exception obj) Line 217: { Line 218: throw obj; Line 219: } Line 220: finally

Source File: d:\TDMSVS2015Dev\App_Code\DataAccess.cs Line: 218

Stack Trace:

[SocketException (0x2afc): The requested name is valid, but no data of the requested type was found] System.Net.Dns.GetAddrInfo(String name) +6670482 System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) +106 System.Net.Dns.GetHostEntry(String hostNameOrAddress) +109 MySql.Data.Common.StreamCreator.GetDnsHostEntry(String hostname) +75 [Exception: Call to GetHostEntry failed after 00:00:00 while querying for hostname '172.30.2.5,10.14.204.70': SocketErrorCode=NoData, ErrorCode=11004, NativeErrorCode=11004.] MySql.Data.Common.StreamCreator.GetDnsHostEntry(String hostname) +349 MySql.Data.Common.StreamCreator.GetStream(UInt32 timeout) +442 MySql.Data.MySqlClient.NativeDriver.Open() +260 [MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.] DvtTrack.DataAccess.LoadCommandZCAT(MySqlCommand cmd, String DBName) in d:\TDMSVS2015Dev\App_Code\DataAccess.cs:218 DvtTrack.ZCAT.GetTreeData() in d:\TDMSVS2015Dev\App_Code\ZCAT.cs:378 SgdManageCmds.BindCommands() in d:\TDMSVS2015Dev\SGDManageCmds.aspx.cs:2082 SgdManageCmds.Page_Load(Object sender, EventArgs e) in d:\TDMSVS2015Dev\SGDManageCmds.aspx.cs:37 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51 System.Web.UI.Control.OnLoad(EventArgs e) +95 System.Web.UI.Control.LoadRecursive() +59 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +780


Any idea on what is going wrong here?

Thanks,
Anil

Options: ReplyQuote


Subject
Written By
Posted
Mentioning Multiple servers in Connection String does not work with MySQL.Net Connector
October 25, 2017 11:56AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.