Re: connecting to Mysql server running on a different machine
I have the same problem, can't connect anywhere except localhost.
And the problem is either with the connection string (I doubt it..), or the connector itself.
Because if I don't supply any server name or ip, it throws an exception, this is good. But no matter what dns / ip I set in connection string, it tries to connect to localhost, and fails because the username / password is different on my loaclhost then the remote server.
This is how i create connection string:
private string BuildConnectionString(string server, int port, string username, string password, string dbname)
{
MySqlConnectionStringBuilder msb = new MySqlConnectionStringBuilder();
msb.Server = server;
msb.Port = Convert.ToUInt32(port);
msb.UserID = username;
msb.Password = password;
msb.Database = dbname;
msb.CharacterSet = "utf8";
return msb.ToString();
}
It's working if it is the localhost, but nowhere else....
And I get an exception stating, that it can't connect username@localhost....
But I set the remote host to connect to......
And I'm out of ideas....