【问题标题】:Not able to connect from Google Cloud Compute Engine to Cloud SQL server无法从 Google Cloud Compute Engine 连接到 Cloud SQL 服务器
【发布时间】:2020-09-25 02:03:58
【问题描述】:

我正在尝试从 Google Cloud Compute Engine 实例连接到 Cloud SQL 服务器实例,这是针对 Microsoft SQL 格式的相对较新的 Google Cloud SQL 服务。计算引擎与 sql 实例位于同一项目中。我正在关注this tutorial。我已经使用 pip 安装了mssql-cli,然后像教程中一样执行此命令:

 ~$ gcloud sql connect sql-practice-ms --user=root

然后它开始看起来很有希望:

    Whitelisting your IP for incoming connection for 5 minutes...done.

但过了一分钟左右,我得到了这个错误:

    ERROR: (gcloud.sql.connect) Mssql-Cli client not found.  Please install a mssql-cli client and make sure it is in PATH to be ab
    le to connect to the database instance.
    ~$

【问题讨论】:

标签: sql-server google-cloud-platform google-cloud-sql


【解决方案1】:

最后,我注意到管理用户被自动称为sqlserver 而不是root,并且意识到它在 Ubuntu 中运行最好,因此通过使用 Ubuntu 机器,我能够解决这个问题。当我使用它时,它就会起作用:

gcloud sql connect sql-ractice-ms --user=sqlserver -d testdb

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-08-15
    • 1970-01-01
    • 1970-01-01
    • 2023-03-30
    • 1970-01-01
    • 1970-01-01
    • 2019-11-27
    • 2013-06-15
    相关资源
    最近更新 更多