简体   繁体   English

从我的PC远程访问使用Ubuntu Server 14.04安装在VPS上的MySQL MySQL 5.6

[英]Remote access from my PC to MySQL 5.6 installed on VPS with Ubuntu Server 14.04

I have just bought VPS and installed mysql-server-5.6 on it. 我刚刚购买了VPS并在其上安装了mysql-server-5.6。 I will be deploying app which uses this database but for now I would like to connect to the database I created from my PC or laptop using, for example, Navicat. 我将部署使用该数据库的应用程序,但现在,我想使用Navicat连接到从PC或笔记本电脑创建的数据库。

How can I do that? 我怎样才能做到这一点? I know its called remote access and found examples like this one: http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html but the problem is, that my computer/laptop often changes IP address, so I cant grant access using particular IP address. 我知道它称为远程访问,并找到了这样的示例: http : //www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html,但问题是,因为我的计算机/笔记本电脑经常更改IP地址,所以我无法授予使用特定IP地址的访问权限。

Is it possible to grant access to full database/or single table, but not to particular IP? 是否可以授予对完整数据库/或单个表的访问权限,但不授予对特定IP的访问权限?

Lets assume I would create in MySQL some user with login and password. 假设我将在MySQL中创建一些具有登录名和密码的用户。 And then, when logging from Navicat I would have to pass these login/password to connect to db? 然后,从Navicat登录时,我必须通过这些登录名/密码才能连接到db?

I hope you see what I mean. 我希望你明白我的意思。 Thanks for you answers! 感谢您的回答!

Ok. 好。 Requirements: 要求:

You have a rented server with MySQL installed, located elsewhere. 您在其他位置有一个装有MySQL的租用服务器。 You have 1+ computers located inside your local network that need to connect to a basic database also inside your network, until you deploy to the server. 在本地网络中有1台以上的计算机,它们还需要在网络内部也连接到基本数据库,直到部署到服务器为止。

Once you go to the server, you can use the IP address given for it (if it is statically assigned) or use the host-provided DNS fully qualified domain name for it to resolve to a dynamically assigned IP. 转到服务器后,您可以使用为其指定的IP地址(如果它是静态分配的),也可以使用主机提供的DNS完全合格的域名来解析为动态分配的IP。

For now, you can STATICALLY assign your Private IP address for the computer the database resides on in your network. 现在,您可以为数据库驻留在网络中的计算机静态分配您的专用IP地址。 Log in to your router, find the static section, assign a private IP (typically 192.xxsmall number) that's NOT currently in use on your local network. 登录到路由器,找到静态部分,分配一个本地IP当前未使用的私有IP(通常为192.xxsmall号)。 Reboot the machine and run IPconfig/Ifconfig and verify that it has this statically assigned IP address. 重新启动计算机并运行IPconfig / Ifconfig,并确认它具有此静态分配的IP地址。

NOTE: this address will only be useable by other machines on the same network. 注意:该地址仅可用于同一网络上的其他计算机。 To go OUTSIDE your local network and connect BACK into your local network, you must purchase DNS from someone and port forward from your router to the proper machine. 要走出本地网络并向后连接到本地网络,必须从某人处购买DNS,并将端口从路由器转发到适当的计算机。

Now use this IP address in your login/connection request. 现在,在您的登录/连接请求中使用该IP地址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM