i want to access database in google cloud server via TCP Forwarding, I have username
= root password
= my-password, server-name
i am doing:
gcloud compute start-iap-tunnel sg01dbcluster-node-2 3306 --local-host-port=localhost:3307 --zone=asia-southeast1-b
output:
Listening on port [3307].
but i have error:
Failed to Connect to MySQL at localhost:3307 with user root
Lost connection to MySQL server at 'reading initial communication packet', system error: 0
any idea what step that i missed?
i have done fixing the connecting problem, before that i am sounding that i have a instances-name, username root and password my-password to connect database in cloud server (the database was sql) via TCP IP forwarding. cloud server was google cloud compute engine. here are the step:
in local
gcloud config set (i am using config set project and zone, don't forget using alpha/beta if the code doesn't running)
TCP Other connection (check last section)
gcloud beta compute start-iap-tunnel my-instances-name 3306 --local-host-port=localhost:3309
wait a second until show:
Listening Port [3309]
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.