Problems installing Cloud SQL Proxy on Windows 64-bit

半腔热情 提交于 2019-12-08 08:15:40

问题


I'm trying to install Cloud SQL Proxy for Google Cloud Platform on my Windows 10 64 bit OS, so I can use Python scripts to dump data into SQL. I'm following this guide to get it set up.

I created a project and a Google Cloud SQL instance from the Console without any issues, and it shows up in the SDK shell without any problems. After downloading the proxy installer and installing it, a dialog window opens up and then closes before I can read it.

When I go to the Google Cloud SDK shell and try to start the Cloud SQL Proxy with: cloud_sql_proxy.exe -instances="[MyInstanceConnectionName]"=tcp:3306

No matter how many times I try, it throws the error "Cloud Sql Proxy is not recognized as an internal or external command, operable program or batch file." I already tried re-downloading and re-executing the file but it still won't work.

I have Python 3.6 with Anaconda and Google Cloud SDK shell installed on Windows 10 64-bit.


回答1:


When you download the cloud_sql_proxy file make sure to rename it as per instructions in the how to guide. Also make sure you save it in the root directory of where you will run it from. E.g. If you are running the command from C:/users/desktop>.\cloud_sql_proxy.exe -instances="[YOUR_INSTANCE_CONNECTION_NAME]"=tcp:3306 then the cloud_Sql_proxy file must be located in the root C drive.




回答2:


Open PowerShell or whatever terminal you use and navigate to the folder you saved cloud_sql_proxy.exe then add .\ like so:

.\cloud_sql_proxy.exe -instances="[YOUR_INSTANCE_CONNECTION_NAME]"=tcp:3306



回答3:


Go to folder where you save proxy exe file and run following command

.\{cloud_sql_proxy file name}.exe -instances={projectID}:{zone}:{sql instance name}:{database}=tcp:{port} -credential_file={service account file path}

For instance related detail go to the instance look for "Instance connection name"



来源:https://stackoverflow.com/questions/50549063/problems-installing-cloud-sql-proxy-on-windows-64-bit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!