Reputation: 155
I have installed mysql on a VM in gcp using this: https://cloud.google.com/architecture/setup-mysql (I manually installed it on a VM)
But I am not able to connect to it using DBeaver. I am using the external IP provided in the dashboard and I have allowed 3306 but even then I am not able to connect to it. I keep getting connection refused: 4003 error
Upvotes: 0
Views: 320
Reputation: 3301
connection refused: 4003 error
This means the instance isn't listening on the port you're trying to connect to or the firewall is closed. In order to fix this error, we need to ensure that the listening process on the VM runs and listens on the correct port. Then, we verify if the Google Cloud firewall is configured correctly and open
You should look for default-allow-ssh to see if your firewall's rules allow SSH connections. If the firewall and IAP do not resolve your issue.
Check whether you have access. When you add a user and grant privileges to them (or with existing users) you need to specify the host or network range from which that user is allowed to connect. Follow the steps in this stack question and check whether you can connect now.
for more information follow How To Allow Remote Connections To MySQL. Attaching SSH troubleshooting doc.
Upvotes: 1