首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GMail插件/应用程序脚本无法连接到Google允许调用getCloudSqlConnection

问GMail插件/应用程序脚本无法连接到Google允许调用getCloudSqlConnection
EN

Stack Overflow用户
提问于 2018-08-13 09:01:48
回答 1查看 405关注 0票数 1

我正在编写一个简单的附加程序,它将从我们的DB获取每个消息的发件人的数据。GMail外接程序获取消息id,并查询我们的DB以获得有关客户端的其他数据,以便向用户显示。

我遵循了CloudSQL教程,对于MySQL和Postgres,在最简单的场景中,我得到了这个错误

您没有权限调用getCloudSqlConnection

当我试图连接到时。不过,从外部与外部客户端连接没有问题。

代码如下

代码语言:javascript
复制
var conn = Jdbc.getCloudSqlConnection("jdbc:google:mysql://[my-project-and-instance-id]/[my-db-name]", [user], [password]);

我的脚本与数据库附带在同一个项目上。

在互联网上搜索“您没有权限调用getCloudSqlConnection”提供了一个空的结果。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-08-14 11:17:01

在我的清单文件中包括"https://www.googleapis.com/auth/sqlservice“到"oauthScopes”,为我修复了错误。

更新范围:

代码语言:javascript
复制
"oauthScopes": ["https://www.googleapis.com/auth/gmail.addons.execute","https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/sqlservice", "https://www.googleapis.com/auth/sqlservice.admin", "https://www.googleapis.com/auth/gmail.readonly", "https://www.googleapis.com/auth/script.external_request", "https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/gmail.addons.current.action.compose"]
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51818708

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档