Not able to connect from Google Cloud Compute Engine to Cloud SQL server

ltskdhd1  于 5个月前  发布在  Go
关注(0)|答案(2)|浏览(99)

I'm trying to connect to a Cloud SQL server instance, which is the relatively new Google Cloud SQL service for the Microsoft SQL format, from a Google Cloud Compute Engine instance. The compute engine is located in the same project as the sql instance. I'm following this tutorial exactly. I've installed the mssql-cli using pip and then I execute this command as in the tutorial:

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

It then starts looking promissing:

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

But after a minute or so, I get this error:

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.
    ~$
7uzetpgm

7uzetpgm1#

In the end, I was able to solve this by noting that the administrative user is automatically called sqlserver and not root and by realizing that it would work best in Ubuntu and thus by using an Ubuntu machine. When I use that then it works:

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

nlejzf6q2#

I had the same error, for me the fix was to install the mssql-cli in python because Google Cloud CLI uses python:

pip install mssql-cli

相关问题