Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot connect to MySQL db only on one machine
    primarykey
    data
    text
    <p>I am using the <a href="http://dev.mysql.com/downloads/connector/net/" rel="nofollow">MySQL Connector/Net 6.7.4</a> to send and receive data to a MySQL database in a Windows 8 Store app. It works perfectly one one machine, but not on another. </p> <p>Here is the error:</p> <blockquote> <p>A first chance exception of type 'System.AggregateException' occurred in mscorlib.dll A first chance exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.RT.DLL A first chance exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.RT.DLL A first chance exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.RT.DLL MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts. ---> System.AggregateException: One or more errors occurred. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled. --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait() at MySql.Data.Common.MyNetworkStream.OpenConnection() at MySql.Data.Common.MyNetworkStream.Open() at MySql.Data.Common.MyNetworkStream.CreateStream(MySqlConnectionStringBuilder settings, Boolean unix) at MySql.Data.Common.StreamCreator.GetTcpStream(MySqlConnectionStringBuilder settings) at MySql.Data.Common.StreamCreator.GetStream(MySqlConnectionStringBuilder settings) at MySql.Data.MySqlClient.NativeDriver.Open() --- End of inner exception stack trace --- at MySql.Data.MySqlClient.NativeDriver.Open() at MySql.Data.MySqlClient.Driver.Open() at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection() at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() at MySql.Data.MySqlClient.MySqlPool.GetConnection() at MySql.Data.MySqlClient.MySqlConnection.Open() at QuantiView.Classes.clsGlobal.mMySqlConnect() A first chance exception of type 'System.InvalidOperationException' occurred in MySql.Data.RT.DLL A first chance exception of type 'System.InvalidOperationException' occurred in mscorlib.dll System.InvalidOperationException: Connection must be valid and open. at MySql.Data.MySqlClient.MySqlConnection.Throw(Exception ex) at MySql.Data.MySqlClient.MySqlCommand.Throw(Exception ex) at MySql.Data.MySqlClient.MySqlCommand.CheckState() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader() at QuantiView.Classes.clsGlobal.d_<em>20.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at QuantiView.Pages.p1Project.d</em>_f.MoveNext()</p> </blockquote> <p>And the connection code:</p> <pre><code>public static void mMySqlConnect() { Debug.WriteLine("mMySqlConnect"); Debug.WriteLine("internet = " + IsInternet()); if (connection.Equals(null)) connection = new MySqlConnection(connectionString); try { if (connection.State.Equals(ConnectionState.Closed)) connection.Open(); } catch (MySqlException ex) { Debug.WriteLine(ex.ToString()); switch (ex.Number) { case 0: Debug.WriteLine("Cannot connect to server. Contact administrator"); break; case 1045: Debug.WriteLine("Invalid username/password, please try again"); break; } } } </code></pre> <p>The two machines are both running Win8.1 fully updated, the same version of VS (2013 also updated), have the same references and installed assemblies, are connected to the same network.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload