我可以远程连接到位于网络托管服务器上的 mysql 数据库吗?

发布于 2024-08-23 22:08:30 字数 191 浏览 1 评论 0原文

我想连接到在网络托管公司 (siteground) 的服务器中运行的 MySQL 数据库。

这个可以实现吗?有没有像(3306)这样的端口可以连接mysql数据库?

如果没有,是否有任何在线服务器可以实现这一点?

PS:我使用的是Delphi,并且我在本地使用ODBC使用MySQL。

I want to connect to a MySQL database that is running in a server located in a web hosting company (siteground).

Can this be achieved?, is there a port to connect to the mysql database like (3306)?

If not, are there any servers online where this can be achieved?

PS: I'm using Delphi, and I'm using MySQL locally using ODBC.

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

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

发布评论

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

评论(5

我们的影子 2024-08-30 22:08:30

这取决于您的托管提供商,您必须询问他们。 3306 通常是正确的端口。

但通常情况下,出于安全原因,该端口对于外部访问是关闭的。

It depends on your hosting provider, you would have to ask them. 3306 is usually the right port.

Usually, though, that port is closed for access from outside for security reasons.

终遇你 2024-08-30 22:08:30

非常感谢大家。

问题解决了! :D

我联系了托管公司的支持人员,他们告诉我这是可能的,并给了我这个有用的链接

http://kb.siteground.com/article/I_have_problems_accessing_my_mysql_database_remotely.html

我所要做的就是添加一个“远程mysql主机”,这是我的IP,然后我将数据库添加到Windows odbc和它工作得很好,就像它在本地数据库中一样(只是速度较慢)。

Thank you very much everybody.

problem solved! :D

I contacted the support at the hosting company, and they told me its possible and gave me this useful link

http://kb.siteground.com/article/I_have_problems_accessing_my_mysql_database_remotely.html

all I had to do is to add a 'remote mysql host' which is my ip, and then I added the database to the windows odbc and it worked fine, as if it where local db (only slower).

花心好男孩 2024-08-30 22:08:30

如果您可以通过 ssh 访问托管提供商,则可以创建隧道,然后将所有本地流量路由到该隧道。在您的本地计算机中执行如下操作:

ssh -L3306:localhost:3306 [email protected]

提供您的密码,您执行 ssh 命令的计算机将把端口 3306 重定向到托管提供商。也就是说,如果您在执行命令的计算机上连接到 localhost:3306,它实际上会连接到托管提供商。

If you have ssh access to your hosting provider you can create a tunnel and then route all local traffic to it. In your local machine do something like this:

ssh -L3306:localhost:3306 [email protected]

provide your password and the machine on which you executed the ssh command will have port 3306 redirected to the hosting provider. This is, if you connect to localhost:3306 on the machine on which you executed the command it will actually be connecting to the hosting provider.

空城旧梦 2024-08-30 22:08:30

我想你可以,但你必须启用它。尝试阅读文档

您可以通过将外部位置的域名或 IP 地址添加到允许远程访问数据库的主机列表来允许从外部位置访问 MySQL 数据库。此外,如果您想使用远程数据库管理应用程序来管理数据库,则应将建立连接的 IP 地址添加到允许的主机列表中。

为了添加允许的主机,您应该通过 cPanel 访问该工具 ->远程MySQL:

在主机字段中,您应该输入所需的域名或 IP 地址:

单击“添加主机”按钮。

一条确认消息将通知主机已成功添加。下次访问远程 MySQL 时,新添加的主机将列在访问主机下。

I guess you can but you have to enable it. Try reading documentation

You can allow access to MySQL databases from an external location by adding its domain name or IP address to the list of hosts that are allowed to access your databases remotely. Additionally, if you would like to manage your database using an application for remote database management, the IP address from which the connection is established should be added to the list of allowed hosts.

In order to add allowed hosts you should access the tool via cPanel -> Remote MySQL:

In the Host field you should enter the desired domain name or IP address:

Click on the Add host button.

A confirmation message will inform that the host is successfully added. Next time you access Remote MySQL the newly added host will be listed under Access Hosts.

只等公子 2024-08-30 22:08:30

也许你可以尝试这个,它使用来自sqlyog和indy的http隧道
通过 HTTP 隧道连接到 MySQL 服务器

may be you can try this, it uses http tunnel from sqlyog and indy
Connecting to MySQL Server Through HTTP Tunnel

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