如何从远程计算机(而不是本地主机)访问MySQL? [英] How to access MySQL from a remote computer (not localhost)?

查看:68
本文介绍了如何从远程计算机(而不是本地主机)访问MySQL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将开发环境设置为vmware中的Ubuntu服务器(安装了LAMP).该vmware在我的本地Windows 7计算机上运行.当我尝试通过HeidiSQL程序访问我的mysql服务器时,连接失败.我得到一个:

I have my dev environment set up as a Ubuntu Server (with LAMP installation) inside a vmware. The vmware is running on my local windows 7 machine. When I try to access my mysql server via HeidiSQL program the connection fails. I get a:

Server Error 2003, can't connect to mysql server on <IP ADRESS HERE>

但是我可以通过PhpMyAdmin访问数据库服务器. MySQL正在运行,我的连接凭据和端口都正确.

I can however access the db server via PhpMyAdmin. MySQL is running and my connection credentials and port are all correct.

我读到,您应该在my.cnf文件中输入要尝试连接的计算机的IP地址作为绑定地址".我做到了我同时尝试了内部网络IP和在线IP.还是没有运气,同样的消息.

I read that you should enter the IPs of the computer you are trying to connect from as the "bind address" in the my.cnf file. Which I did. I tried both the internal network IP as well as the online IP. Still no luck, same message.

由于这不是生产环境,因此理想情况下,我希望允许任何人访问该服务器,而不是受IP限制.特别是由于我的ISP分配了动态IPS.因此,假设它仍然有效,我将不得不一直对其进行更改.

Since this isn't a production environment I would ideally like to allow anyone to access that server, not limit it by IP. Especially since my ISP assigns dynamic IPS. So I would have to change it all the time, assuming that even works.

那么有人知道我如何从远程计算机连接到我的MySQL服务器吗?

So does anyone know how I can connect to my MySQL server from a remote computer?

P.S.我认为这是开发人员必须处理的事情,所以我在这里而不是在超级用户"中发布了它.如果必须迁移,请将其发送给服务器故障",而不是超级用户".

P.S. I assume this is something developers have to deal with that's why I posted it here and not Super User. If it must be migrated please send it to Server Fault not Super User.

推荐答案

对于Heidi SQL,我能够按照本文中的说明进行操作:

For Heidi SQL I was able to get it to work following the instructions on this article:

http://mysql- tools.com/en/articles/http-tunnel/73-heidisql-a-http-tunnel.html

它使用一个名为HTTP隧道的程序.它慢很多,但至少可以用.如果您使用Navicat,它将附带一个PHP文件,您可以将其上传到服务器,它将通过该文件进行连接.

It uses a program called HTTP Tunnel. It's a lot slower but at least it works. If you use Navicat it comes with a PHP file that you can upload to your server and it will connect via that.

这篇关于如何从远程计算机(而不是本地主机)访问MySQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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