相反主机名,我使用了IP地址,谷歌脚本仍然提供"未能建立连接,无效的连接字符串,用户名或密码",我有交叉检查数据,以及mysql端口..一切都很好..但仍然存在问题。
function DBWrite(){
var address ='202.47.118.131:3306';
var user = "root";
var pwd="";
var db= "smsbrn";
var cform=FormApp.getActiveForm();
var formId=cform.getId();
var dbUrl='jdbc:mysql://' + address + '/' + db;
***var conn=Jdbc.getConnection(dbUrl, user, pwd);** //connection fails here.*
}
答案 0 :(得分:1)
您是否已将防火墙上的Google IP列入白名单?
64.18.0.0 - 64.18.15.255
64.233.160.0 - 64.233.191.255
66.102.0.0 - 66.102.15.255
66.249.80.0 - 66.249.95.255
72.14.192.0 - 72.14.255.255
74.125.0.0 - 74.125.255.255
173.194.0.0 - 173.194.255.255
207.126.144.0 - 207.126.159.255
209.85.128.0 - 209.85.255.255
216.239.32.0 - 216.239.63.255
您的MySQL服务器是否也允许对该给定用户或任何其他用户进行远程访问?你可以在这里找到如何做到这一点。