Question

Mysql remote access through private IP

Posted January 25, 2018 3.2k views
MySQLUbuntu 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.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

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

Submit an Answer