I am testing the following configuration.
With the above configuration I am able to logon to testsql-1 from TestVM-1 with below command:
`mysql -h 127.0.0.1 --port 9090 -u testuser -D testDB -p`
However I am not able use the internal IP of TestVM-1 in the above command. It gives an error.
Another observation is I am able to do telnet 127.0.0.1 9090
but when I try telnet <VM -Internal-IP> 9090
returns a connection refused error.
Does anyone know if this is expected behaviour? If this is expected, why is it so?
The reason that you can connect to 127.0.0.1
but you cannot connect using the VM's private IP address is that the Proxy is NOT listening on the private IP address.
The Cloud SQL Proxy listens on the loopback adapter's internal address which is 127.0.0.1
. This address only exists inside the computer.