与mysql的连接错误 [英] error of connection to mysql

查看:85
本文介绍了与mysql的连接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

当我创建与MySQL的c#.net 2005连接时,给出错误,错误为

"错误[HY000] [MySQL] [ODBC 5.1驱动程序]无法连接到本地主机"上的MySQL服务器(10061)
错误[HY000] [MySQL] [ODBC 5.1驱动程序]无法连接到MySQL服务器"

这是我的代码

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

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");



和我的服务器名称是本地主机,当我与vb 6.0连接时可以正常工作,但是当我使用C#.net 2005时出现错误


请帮助我.



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.

推荐答案

看看下面的链接.

http://www.cryer.co.uk/brian/mysql/trouble_odbc_cant_connect_on_localhost.htm
Have a look at below link.

http://www.cryer.co.uk/brian/mysql/trouble_odbc_cant_connect_on_localhost.htm


这篇关于与mysql的连接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆