Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从google VM使用django连接到google云SQL_Sql_Django_Google Cloud Platform_Google Cloud Sql - Fatal编程技术网

从google VM使用django连接到google云SQL

从google VM使用django连接到google云SQL,sql,django,google-cloud-platform,google-cloud-sql,Sql,Django,Google Cloud Platform,Google Cloud Sql,我试图用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 怎么能修好呢 (注意:它在我的本地计算机上工作,但不是在VM实例上:/)这是一个安全警告,试图帮助您保护私钥的安全。在linux上,可以使用以下命令修改文件的权限: chm

我试图用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
怎么能修好呢


(注意:它在我的本地计算机上工作,但不是在VM实例上:/)

这是一个安全警告,试图帮助您保护私钥的安全。在linux上,可以使用以下命令修改文件的权限:

chmod 600“谷歌密钥/客户端密钥.pem”

这将限制谁可以读写该文件,从而使非特权用户无法获取该文件的内容。您可以在中阅读有关
chmod
的更多信息

如果文件权限是您的问题,并且您需要密钥权限为0600,则可以使用
chmod
命令
chmod 600客户端密钥.pem
@anowlinorbit谢谢!我如何执行它?我需要在安装了gcp的cmd上本地执行还是在服务器上执行?如果此错误是从Django主机生成的,则需要在Django主机上的命令行上运行此错误。在我给出的示例中,您需要与
client key.pem
@Tomergt45位于同一目录中,在使用
chmod
命令并为该密钥授予正确权限后,您可以从计算引擎虚拟机连接到云SQL实例?