You can connect to a remote mysql server via your localhost very simply and securely. You do this by opening a SSH tunnel on the mysql port.
On a MacBook or Ubuntu/Linux system run this command in your terminal
ssh -L 3306:127.0.0.1:3306 email@example.com
Simply replace the username that you have on your mysql server, and replace myserver.com with your servers IP address or domain.
Once this has been done, keep the terminal open and open a new terminal. Check you can connect to the sql database using either localhost or 127.0.0.1 on port 3306.