“无法建立数据库连接”后面的根错误是什么?检查连接字符串,用户名和密码。“ [英] What is the root error behind "Failed to establish a database connection. Check connection string, username and password."

查看:127
本文介绍了“无法建立数据库连接”后面的根错误是什么?检查连接字符串,用户名和密码。“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过google和stackoverflow,我发现了一些问题:无法建立数据库连接,请检查连接字符串,用户名和密码。但是,我找不到任何人发现了底层错误。



我试图用数据库连接编写我的第一个Google脚本;我有一个mysql和oracle jdbc getConnection,它们都产生了这个错误。我已经检查,双重和三重检查连接信息无济于事。我知道数据库是可访问的(可以通过其他客户端从几个不同的机器上获得,例如Linux上的php,在家中的各种windows PC上的sql开发人员和工作)。我如何确定真正的错误是什么?提交给我的错误过于泛泛而抽象。

环境:
在Google电子表格中使用脚本(从而继承任何由Google建立的环境)。我正在尝试使用Google API jdbc,并且没有关于环境变量的更多信息。

使用以下语法:

var url =jdbc:mysql://mysql.cb-pta .COM:3306 / u4lottery;
var conn = Jdbc.getConnection(url,user,password);



同样,用户名和密码已经过验证。

是一个已知的bug,它会导致使用主机名的jdbc连接出现问题。改为使用IP地址。



奇怪,但是真的..我在这个bug中失去了将近2天....



这里是错误报告的链接.... < a>


Looking through google and stackoverflow, I found a number of questions asking about "Failed to establish a database connection. Check connection string, username and password." However, I cannot find anyone that has found what the underlying error is.

I am trying to write my first google script with a database connection; I have a mysql and oracle jdbc getConnection, both of which spawn this error. I have checked, double- and triple-check the connection information to no avail. I know the databases are accessible (can get in through other clients from several different machines like php on a linux box, sql developer on various windows PCs at home and work). How do I determine what the real error is? The error as presented to me is way too generic and abstract.

Environment: Using a script in a Google Spreadsheet (thus inheriting whatever environment is established by google). I am attempting to use the Google API jdbc and have no further knowledge of the environment variables.

Using the following syntax:

var url = "jdbc:mysql://mysql.cb-pta.com:3306/u4lottery"; var conn = Jdbc.getConnection(url, user, password);

Again, user and password have been verified.

解决方案

There is a known bug which causes problems with jdbc connections using hostnames. Try using an Ip address instead.

Bizarre, but true.. I lost almost 2 days with this bug....

Here is the link to the bug report....

这篇关于“无法建立数据库连接”后面的根错误是什么?检查连接字符串,用户名和密码。“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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