【发布时间】:2020-09-06 11:12:00
【问题描述】:
我想通过 TCP 转发访问谷歌云服务器中的数据库,我有 username = root password = my-password , server-name
我在做:
- 在云服务器中设置 TCP 转发
gcloud 计算 start-iap-tunnel sg01dbcluster-node-2 3306 --本地主机端口=本地主机:3307 --zone=asia-southeast1-b
输出:
Listening on port [3307].
- 然后我使用 mysql 工作台连接到数据库服务器 主机名本地主机 端口:3307 用户名:根 密码:我的密码
但我有错误:
Failed to Connect to MySQL at localhost:3307 with user root
Lost connection to MySQL server at 'reading initial communication packet', system error: 0
知道我错过了哪一步吗?
【问题讨论】:
标签: mysql tcp gcloud portforwarding