Bug #13345 Connecting from mono 1.1.8 to MySQL 5.0 using MySQL Connector/Net 1.0.5
Submitted: 20 Sep 2005 10:30 Modified: 23 Sep 2005 15:51
Reporter: Rami Radi Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:1.0.5 OS:Windows (Windows XP/Linux)
Assigned to: Reggie Burnett CPU Architecture:Any

[20 Sep 2005 10:30] Rami Radi
Description:
I am migrating an .NET application from Windows to Linux, and I am using Mono 1.1.8, Mono .NET Connector 1.0.5 and MySQL 5.0 to do so.

The original MSSQL database of this application uses many stored procedures, so i have to use MySQL 5.0. I ported the database successfully after doing some minor changes to the way the stored procedures are written.

Now from Microsoft Visual studio, i use the Mono .NET connector 1.0.5, and i am able to compile and run the application sucessfully without any problems.

But when i compile my application using Mono 1.1.8 on Windows or Linux, it compiles sucessfully, but shows a message when first loading saying "Unable to connect to any of the specified MySQL hosts.

To isolate the problem, I tried a sample piece of code that i am including below, that connects to any test database on my local MySQL5.0 that displays the version of the MySQL database it connected to, and ends.

Again it works fine from within Visual Studio.NET and the followig is displayed:

Will attempt to open connection now...
Connection opened...
5.0.12-beta-nt
end..

but when compiling it from mono this way:
mcs -out:connector.exe -r:MySql.data.dll *.cs

and running it like using "mono connector.exe" only the following appears and the program returns back the command prompt

Will attempt to open connection now...

Is this a bug in the MySQL Connector, or Mono itself?

Thank you very much for your help.

Waiting for a reply.

How to repeat:
using System;
using MySql.Data;
using MySql.Data.MySqlClient;

namespace MySQLConnector
{
	/// <summary>
	/// Summary description for Class1.
	/// </summary>
	class Class1
	{
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main(string[] args)
		{
			//
			// TODO: Add code to start application here
			//

			MySqlConnection conn;
			conn = new MySqlConnection();
	
			conn.ConnectionString = "server=localhost;userID=root;password=rest;database=photos;pooling=false";
			Console.WriteLine("Will attempt to open connection now...");
			conn.Open();
			Console.WriteLine("Connection opened...");
			Console.WriteLine(conn.ServerVersion);
			Console.WriteLine("end..");
			Console.ReadLine();

		}
	}
}
[20 Sep 2005 12:00] oiaohm
This Fault is Critical.

Providing a notice of Replication.  This is a fair warning.  I Will fork the code and repair the fault.  If a person is assigned I will consider submiting the code.  If not due to lack of support for Mono and PNet the fork will appear on sourceforge.net. Also all provided connectors for GPL only will be started to be replicated in LGPL.  I will be looking for developers to take up the battle.

Hostile production of code should not be taken lightly.  Mysql took over the connector turning it from a LGPL licence to a GPL licence.  Now taken a hit a opensource solutions is not a wise business move when you depend on good will.  The connector you took over was built to support Mono and PNet as well as Microsoft back steping is not a option.

You have a week from the 20 Sep 2005.
[20 Sep 2005 13:25] Reggie Burnett
Rami

I am the original author of the ByteFX code and am the maintainer of Connector/Net.  It was an oversight that 1.0.5 shipped broken on Mono.  I have since corrected that and will be releasing 1.0.6 either today or tomorrow.
[20 Sep 2005 15:06] Reggie Burnett
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Fixed in 1.0.6
[22 Sep 2005 9:51] Rami Radi
Thank you Reggie for your help. I really appreciate it. Unfortunately, I am not that experienced in building the source from the repository. I tried doing that when I didn’t find the 1.0.6 build released yet, but I had only instructions on how to download the MySQL source, not the connector.

Will be releasing the 1.0.6 version any time soon? If so I can wait till you do so, if not, can you direct me to how to build the connector source from the repository?

Thank you very much.

Rami
[23 Sep 2005 15:51] Mike Hillyer
Documented in 1.0.6 changelog:

<listitem>
        <para>
          &connector_net; 1.0.5 could not connect on Mono. (Bug #13345)
        </para>
      </listitem>