无法使用VB6连接到远程MySQL(10060) [英] Cannot connect to remote MySQL with VB6 (10060)

查看:148
本文介绍了无法使用VB6连接到远程MySQL(10060)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从GKG.net获得了一个托管计划,并且有一个VB6连接字符串可以远程访问其中的MySQL数据库.我遵循了有关如何远程访问MySQL服务器的所有说明和教程.一切都很好,直到出现错误提示:

I got a hosting plan from GKG.net and I have a VB6 connection string to remotely reach MySQL database in it. I followed all instructions and tutorials about how to reach MySQL server remotely. Everything was fine till i get an error that says:

[MySQL] [ODBC 3.51驱动程序]无法连接到'xxx.xxx.xxx.xxx'(10060)上的MySQL服务器

[MySQL][ODBC 3.51 Driver] Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (10060)

我在网上搜索了一个小时的解决方案,但是仍然没有任何意义..我仔细检查了连接..我可以ping到我的静态ip,但是无法访问其中的MySQL服务器.

I searched for a solution over the net for hours but still there is nothing makes sense about it.. I double checked my connections.. I can ping to my static ip, but cant reach the MySQL server in it.

从CPanel可以使用phpMyAdmin访问我的数据库.我测试了我的数据库,它没有任何问题.一切似乎都正确.除非我仍然收到VB6错误消息

From CPanel i can reach my db with phpMyAdmin. I tested my db and there was nothing wrong with it. Everything seems right. Except i still get the error message with VB6

我的连接字符串:

Dim conn As ADODB.Connection
Dim constr As String
Private Sub OpenServer()
    Set conn = New ADODB.Connection
    constr = "Driver={MySQL ODBC 3.51 Driver};" & _
             "PORT=" & db_port & ";" & _
             "SERVER=" & db_server & ";" & _
             "DATABASE=" & db_name & ";" & _
             "UID=" & db_user & ";" & _
             "PWD=" & db_pass & ";" & _
             "OPTION=3;" & _
             "STMT=;"
    conn.Open constr
End Sub

那么我该如何解决该死的连接问题?和 造成这种情况的几率是多少?

So how can i resolve this damned connection issue? and What are the odds that causes this?

推荐答案

您访问其数据库服务器的主机很少允许从其托管环境外部远程访问数据库(我从未见过).

Hosts where you access their database server very rarely allow remote access to the database from outside their hosting environment (I have never seen it).

如果您自己(在专用或虚拟服务器计划上)设置MySql数据库,则应该能够将其设置为接受远程主机.在这种情况下,您需要修改my.con文件以允许远程主机(您也可以通过MySql Admin工具执行此操作),并且需要授予您尝试使用来自远程IP的访问权限的登录名:

If you setup the MySql database yourself (on a dedicated or virtual server plan) then you should be able to set it up to accept remote hosts. In that case you need to modify your my.con file to allow remote hosts (you can also do it via the MySql Admin tools) and you need to grant the login you are trying to use access from the remote IP:

http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html

您之前关于SQLyog的评论是一个很好的主意.我可以担保该产品.这是一个很棒的工具. MySql提供的免费管理工具(工作台- http://www.mysql.com/downloads/workbench/)也很不错,并且还可以让您测试远程访问.

Your previous comment about SQLyog is a very good idea. And I can vouch for that product. It is a great tool. The free admin tools from MySql (Workbench - http://www.mysql.com/downloads/workbench/) are also decent and will allow you to test remote access as well.

这篇关于无法使用VB6连接到远程MySQL(10060)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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