Click here to Skip to main content
15,917,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello

When i create connection c#.net 2005 to mysql then give error and error is

""ERROR [HY000] [MySQL][ODBC 5.1 Driver]Can't connect to MySQL server on 'localhost' (10061)
ERROR [HY000] [MySQL][ODBC 5.1 Driver]Can't connect to MySQL server ""

this is my code
C#
OdbcConnection os = new OdbcConnection();
                
os.ConnectionString = "DRIVER=MySQL ODBC 3.51 Driver;SERVER=localhost;UID=faruk;PWD=mik;DATABASE=detail;OPTION= & 1 + 2 + 8 + 32 + 2048 + 16384";
os.Open();
MessageBox.Show("Right Connection");


and my server name is localhost when i connect with vb 6.0 then work good but when i use C#.net 2005 then give error


Please help me.
Posted
Updated 22-Sep-11 4:38am
v2

1 solution

 
Share this answer
 
Comments
RaviRanjanKr 22-Sep-11 10:43am    
Nice link suggested, My 5+
RaisKazi 22-Sep-11 10:57am    
Thank you Ravi.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900