简体   繁体   中英

unable to connect to mysql on GCP compute engine

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM