Mysql remote access through private IP

January 25, 2018 632 views
MySQL Ubuntu 16.04

Private networking is set up on both droplets

I have sucessfully set up a remote MySQL connection using public IP, but when I switch the bind-address to the private IP of the database server the remote droplet receives a 110 error and can't connect on the private IP

1 comment
  • My server node:
    has bind-address commented out
    has a test user created in the database linked to the private IP of my client node with privileges granted.
    I can successfully log into the test user on my server node.

    My client node:
    has mysql-client installed
    can log into the test user and see the database as expected.

    Now, the problem is with PDO objects and PHP on my webpage. The page is properly loading but is not able to access the remote db.

    The PDO object is using the same user/password/host that was created and tested on both server and client node.

1 Answer

You should use a SSH tunnel unless you want all your MySQL data plaintext over the network.

Have another answer? Share your knowledge.