通过 LAN 连接到 mySQL

发布于 2024-10-05 22:07:52 字数 684 浏览 0 评论 0原文

大家好,我在连接到本地 LAN 上运行 mySQL 数据库的 PC 时遇到问题。

我的VB6代码是:

.ConnectionString = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=\\SERVERPC;DATABASE=lstoredb;UID=root2;PWD=thepassw;OPTION=3"

如果我输入“localhost”,那么它工作得很好(我的DEV系统上也运行mysql)但是一旦我把它放在另一台机器上,它就永远无法连接。

我可以访问网络中的 SERVERPC,但由于某种原因 VB6 找不到它?我什至尝试过IP地址:

.ConnectionString = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=192.168.1.9;DATABASE=lstoredb;UID=root2;PWD=thepassw;OPTION=3"

但仍然不起作用。关闭了所有防火墙,但仍然没有任何结果...甚至为 192.168.1.9 IP 添加了端口 3306 到我的路由器,但仍然没有任何结果!

DEV 计算机是 Windows XP SP3,mySQL 服务器位于 Vista Home Prem 上。 32 位。

任何帮助都会很棒!谢谢! :o)

大卫

Hey all, i am having problems with connecting to a PC on my local LAN thats running the mySQL database.

The code in VB6 i have is:

.ConnectionString = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=\\SERVERPC;DATABASE=lstoredb;UID=root2;PWD=thepassw;OPTION=3"

If i put "localhost" then it works just fine (i have mysql running on my DEV system as well) But once i put it on the other machine it doesn't ever connect.

I can access the SERVERPC in my network but for some reason VB6 can not find it? I've even tried the IP address:

.ConnectionString = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=192.168.1.9;DATABASE=lstoredb;UID=root2;PWD=thepassw;OPTION=3"

And it still does not work. Turned off all firewalls and still nothing... Even added port 3306 to my router for the 192.168.1.9 IP and nothing still!

The DEV computer is Windows XP SP3 and the mySQL server is on Vista Home Prem. 32-bit.

Any help would be great! Thanks! :o)

David

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

那一片橙海, 2024-10-12 22:07:52

您需要告诉 MySQL 允许某些用户从某些主机远程连接到某些数据库。 来源

You need to tell MySQL to allow remote connections to certain databases from certain hosts for certain users. Source

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文