Bug #10928 MySqlConnection works with VS C# 2003 .NET 1.1, failed with Mono 1.1.7
Submitted: 27 May 2005 20:06 Modified: 3 Jul 2005 7:09
Reporter: Hassan Rom Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:1.0.4 OS:Windows (MS Windows XP Pro)
Assigned to: CPU Architecture:Any

[27 May 2005 20:06] Hassan Rom
Description:
using System;
using System.Data;
using MySql.Data.MySqlClient;

namespace MySQL_Test
{
	/// <summary>
	/// Summary description for Class1.
	/// </summary>
	class Class1
	{
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main(string[] args)
    {
      IDbConnection myConnection = new MySqlConnection("datasource=localhost;database=mysql;uid=root;password=mypassword");
      myConnection.Open();

		}
	}
}

While running the above code which was compiled with Mono 1.1.7, the following exception was retrieved:

Unhandled Exception: MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts
in <0x0067c> MySql.Data.MySqlClient.NativeDriver:Open ()
in <0x00029> MySql.Data.MySqlClient.Driver:Create (MySql.Data.MySqlClient.MySqlConnectionString settings)
in <0x0008d> MySql.Data.MySqlClient.MySqlPool:CreateNewPooledConnection ()
in <0x001ae> MySql.Data.MySqlClient.MySqlPool:GetPooledConnection ()
in <0x0003f> MySql.Data.MySqlClient.MySqlPool:GetConnection ()
in <0x000e3> MySql.Data.MySqlClient.MySqlPoolManager:GetConnection (MySql.Data.MySqlClient.MySqlConnectionString settings)
in <0x00041> MySql.Data.MySqlClient.MySqlConnection:Open ()

But the above code works fine with VS C# 2003 .NET 1.1.

Also, I made sure I am using the correct MySql.Data.dll for .NET 1.1. The MySql  server I am trying to connect to is version 4.1.

How to repeat:
IDbConnection myConnection = new   MySqlConnection   ("datasource=localhost;database=mysql;uid=root;password=mypass");
myConnection.Open();
[28 May 2005 6:15] Vasily Kishkin
Could you try to use the follow ?

IDbConnection myConnection = new   MySqlConnection  
("server=localhost;database=mysql;uid=root;password=mypass");
myConnection.Open();

I mean to replace word  "datasource" on "server"
[31 May 2005 13:40] Hassan Rom
nope.. didn't work neither.
[2 Jun 2005 7:44] Vasily Kishkin
Could you please write here test case that was created by Mono ?
[2 Jun 2005 13:34] Hassan Rom
I did the following in mysql client and the code worked like a charm. A friend of mine told me that mysql server has some "hashing problem". 

SET PASSWORD FOR 'root'@'localhost' = OLD_PASSWORD('mypass');

Therefore, the bug is not in the MySQL Connector/Net but in the mysql server.
I am running MySQL Server 4.1 on Windows XP.
[3 Jun 2005 7:09] Vasily Kishkin
I have never seen the problem on 4.1. Could you please write some example, I would like to reproduce the hash bug. I tried your example without Mono and could't repeat this bug.
[14 Jun 2005 21:58] [ name withheld ]
I'm getting the same thing, I'm using Windows XP SP2, Mono 1.1.7, MySQL 4.1.12a-nt and the latest Connector/Net. If I try and Open a connection using the correct connection string I get

"Unable to connect to any of the specified MySQL hosts"

Help Please!
[3 Jul 2005 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".