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

397 Views Asked by At

I have just bought VPS and installed mysql-server-5.6 on it. 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.

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.

Is it possible to grant access to full database/or single table, but not to particular IP?

Lets assume I would create in MySQL some user with login and password. And then, when logging from Navicat I would have to pass these login/password to connect to db?

I hope you see what I mean. Thanks for you answers!

1

There are 1 best solutions below

0
On

Ok. Requirements:

You have a rented server with MySQL installed, located elsewhere. 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.

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.

For now, you can STATICALLY assign your Private IP address for the computer the database resides on in your network. Log in to your router, find the static section, assign a private IP (typically 192.x.x.small number) that's NOT currently in use on your local network. Reboot the machine and run IPconfig/Ifconfig and verify that it has this statically assigned IP address.

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.

Now use this IP address in your login/connection request.