Bug #5766 Very long time to connect to my database in localhost !
Submitted: 27 Sep 2004 16:45 Modified: 22 Oct 2004 20:04
Reporter: Guillaume Bon Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:all versions OS:Microsoft Windows (Windows XP)
Assigned to: Reggie Burnett CPU Architecture:Any

[27 Sep 2004 16:45] Guillaume Bon
Description:
Hi ,

I've got a problem with the followin code :

private void Page_Load(object sender, System.EventArgs e)
{
 try 
    {
	MyConnection = new MySQLConnection(new MySQLConnectionString("localhost", "qualbil" , "root" ,"qualbil").AsString);
	MyConnection.Open();
	MySQLCommand MyCommand = new MySQLCommand("select * from versions", MyConnection);
				IDataReader MyDataReader =    MyCommand.ExecuteReader();
				MyDataReader.Read();
				Response.Write(MyDataReader[0].ToString() + "  " +  MyDataReader[1].ToString());
			}
 catch (Exception)
     {
	Response.Write(e);
     }
}

This Page opens a connection to my Mysql Database in localhost but every connections makes a so long time ! 
I try every version of mysql (from 3.23 to 5.01) but can't find a solution. 
I think it's a DNS issue but i tried so many ways  and can't solve the problem !
Maybe it's the DHCP or something like that ...

Can someone help me ?

Guillaume - France 

How to repeat:
I would say a local Network with a DHCP. But i m no sure
[14 Oct 2004 14:32] Reggie Burnett
Can you describe how long it is taking to connect?  Can you time it?
[14 Oct 2004 15:56] Guillaume Bon
i would say 10 seconds ... 
But in fact, with the source code of MysqlDriverCS, we used breakpoint and that it's maybe due to a call of a function to "libmysql.dll".
Here is the code MySQLConnection.cs line 325 in unsafe public void Open() : 
"void* retval = CPrototypes.mysql_real_connect(handle,location,userid,password,database,Convert.ToUInt32(port),null,0);"
[17 Oct 2004 15:48] Timothy Parez
It seems it's not just the localhost, but the local network.
At least for me here, when connecting to a remote server it's really fast, but to a localhost or another server in the local subnet it takes ages.
[18 Oct 2004 12:36] Guillaume Bon
In fact, at first, we thought it was a local network problem with the DHCP or something like this but after some comparison test, we found that the problem happens with Norton SystemWorks 2004. Afet uninstalling it, the problem has disappeared ...
It's a weird issue because it works fine with the old workstations for developpement.
In fact we changed our workstation from Athlon XP 3000+ to Pentium 4 3 Ghz and the configuration of the local network personnal IP to DHCP and then the problem appeared...

Don't know why ...

See U
[22 Oct 2004 20:04] Reggie Burnett
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem is not the result of a bug.
For a list of more appropriate places to ask for help using MySQL
products, please visit http://www.mysql.com/support/

Thank you for your interest in MySQL.

Additional info:

Thanks for getting back to me. I'm marking this not a bug.
[7 Mar 2012 6:32] Alex Zimnitski
You should try adding next option to my.cnf/my.ini

[mysqld]
skip-name-resolve

i solved this problem this way.