简体   繁体   English

使用来自 google VM 的 django 连接到 google cloud SQL

[英]Connect to google cloud SQL with django from google VM

I'm trying to connect to my google SQL database from my VM instance with django and I get the following error:我正在尝试使用 django 从我的 VM 实例连接到我的 google SQL 数据库,但出现以下错误:

private key file "./Google Keys/client-key.pem" has group or world access; permis
sions should be u=rw (0600) or less

how can it be fixed?怎么解决?

(Note: it is working from my local machine but not from VM instance :/) (注意:它在我的本地机器上工作,而不是从虚拟机实例:/)

This is a security warning trying to help you keep your private key safe.这是一个安全警告,试图帮助您确保您的私钥安全。 On linux, you can modify the permissions of the file using the following command:在 linux 上,您可以使用以下命令修改文件的权限:

chmod 600 "Google Keys/client-key.pem"

This will limit who can read and write to the file, making it so unprivileged users won't be able to get at the contents.这将限制谁可以读取和写入文件,从而使非特权用户无法获取内容。 You can read more about chmod in the chmod man page .您可以在chmod 手册页中阅读有关chmod更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM