Google Apps脚本中的Jdbc连接错误 [英] Jdbc connection error from Google Apps Script

查看:47
本文介绍了Google Apps脚本中的Jdbc连接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Google Cloud Project MySQL数据库,以与Google Apps脚本提供的Jdbc服务结合使用.连接一切按计划进行.我基本上就像在文档中那样进行连接.

I have created a Google Cloud Project MySQL database to use in conjunction with the Jdbc service provided by Google Apps Script. Everything went as planned with the connection. I am basically connecting as it does in the docs.

var conn = Jdbc.getCloudSqlConnection(dbUrl, user, userPwd);

我与另一个帐户共享了文件,突然之间我看到一个红色错误:

I shared the file with another account and all of a sudden I am seeing a red error saying:

'无法建立数据库连接.检查连接字符串,用户名和密码.'

'Failed to establish a database connection. Check connection string, username and password.'

代码未做任何更改,但是有一个错误.当我回到原来的帐户并运行相同的代码时,没有错误.这是怎么回事有什么想法吗?

Nothing changed in the code, but there is an error. When I go back to my original account and run the same bit of code, there is no error. What is happening here? Any ideas?

推荐答案

我将再次仔细检查应列入白名单的所有IP范围.根据您的描述,它在第一个帐户中工作正常,可能在第二个帐户中,Apps Script使用另一个IP进行连接,该IP未被列入白名单或因某些错字而被列入白名单.您能否分享屏幕截图,您是如何准确地将这条文章中的范围列入白名单的?

I'd double-check once again all IP ranges which should be whitelisted. According to your description it worked fine in first account, probably in second account Apps Script uses another IP for connection, which was not whitelisted or whitelisted with some typo. Could you share screenshot how did you exactly whitelist the ranges from this article?

这篇关于Google Apps脚本中的Jdbc连接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆