0
votes

I get the following error when loading my C# ASP.net page.

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond] System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) +6528783 System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +130

[IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.] System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +296 MySql.Data.Common.MyNetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count) +47

[TimeoutException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.] MySql.Data.Common.MyNetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count) +204 MySql.Data.MySqlClient.TimedStream.Read(Byte[] buffer, Int32 offset, Int32 count) +128 System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count) +262 MySql.Data.MySqlClient.MySqlStream.ReadFully(Stream stream, Byte[] buffer, Int32 offset, Int32 count) +42
MySql.Data.MySqlClient.MySqlStream.LoadPacket() +64
MySql.Data.MySqlClient.MySqlStream.ReadPacket() +32
MySql.Data.MySqlClient.NativeDriver.Open() +253
MySql.Data.MySqlClient.Driver.Open() +22
MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) +208 MySql.Data.MySqlClient.MySqlConnection.Open() +625 UoRLive.iPadLayout.Page_Load(Object sender, EventArgs e) in c:\Users\Corbin Spicer\Documents\FinalYearProject\UoRLive\UoRLive\iPadLayout.aspx.cs:92 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51 System.Web.UI.Control.OnLoad(EventArgs e) +92 System.Web.UI.Control.LoadRecursive() +54 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772

Background:

The script runs perfectly on a local machine when trying to connect to a local MYSQL database, however I have moved it on to smarterasp.net, set up another MYSQL database and now am getting this error message.

The only thing that has changed is the connection string:

public static string GetConnectionString()
    {


        string connStr = String.Format("server={0};user id={1}; password={2}; port={3};" +
                 "database=MYDATABASE_resources; pooling=false", "SQL5011.Smarterasp.net",
                 "DMYDATABSE_resources_admin", "MyPassword", "1433");


        return connStr;
    }

The details are 100% correct and I have checked them by connecting to the server using MYsql workbench.

Any ideas?

1
And you could connect to MySql on the remote server via Workbench using that port?Steve
@Corbin Spicer: were you planning on adding more information to your question?Mitch Wheat

1 Answers

2
votes

1433 is the default SQL Server port.

3306 is the default MySQL port.