我可以远程连接到位于网络托管服务器上的 mysql 数据库吗?
我想连接到在网络托管公司 (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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
这取决于您的托管提供商,您必须询问他们。 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.
非常感谢大家。
问题解决了! :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).
如果您可以通过 ssh 访问托管提供商,则可以创建隧道,然后将所有本地流量路由到该隧道。在您的本地计算机中执行如下操作:
提供您的密码,您执行 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:
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.我想你可以,但你必须启用它。尝试阅读文档
I guess you can but you have to enable it. Try reading documentation
也许你可以尝试这个,它使用来自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