Archive for December, 2015

MySQL: Connect from remote host

Monday, December 28th, 2015

I have been working on some projects and using my home server to complete some initial testing. I continually have issues connecting from my pc to the database. The remote IP on my VPN changes and I have the server pretty well locked down so need to add the current IP address to the access list.

The database name, user, remotehost ip address, and password are required to use the following command. One note, that you should probably not use the ‘root’ user or admin user when setting this command and insure that you do not leave the access on servers where there could be issues with security.

GRANT ALL PRIVILEGES
ON database.*
TO 'user'@'remotehost'
IDENTIFIED BY 'password';

This command has made it possible to connect using DB Visualizer which makes accessing the database very easy.