使用Google脚本连接到mariadb,错误:连接URL使用了不受支持的JDBC协议 [英] connect to mariadb using google scripts,error:Connection URL uses an unsupported JDBC protocol

查看:219
本文介绍了使用Google脚本连接到mariadb,错误:连接URL使用了不受支持的JDBC协议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 GOOGLE 中的代码正确地远程连接mariadb参数.

I am using codes from GOOGLE to connect to mariadb remotely with correct parameters.

    // Replace the variables in this block with real values.
var address = 'database_IP_address';
var rootPwd = 'root_password';
var user = 'user_name';
var userPwd = 'user_password';
var db = 'database_name';

var root = 'root';
var instanceUrl = 'jdbc:mysql://' + address;
var dbUrl = instanceUrl + '/' + db;

// Create a new database within a Cloud SQL instance.
function createDatabase() {
  var conn = Jdbc.getConnection(instanceUrl, root, rootPwd);
  conn.createStatement().execute('CREATE DATABASE ' + db);
}

然后我得到了错误:连接URL使用了不受支持的JDBC协议.

then I got the error: Connection URL uses an unsupported JDBC protocol.

似乎我无法连接到Mariadb,我不知道连接问题是什么.

it seems that i cannot connect to Mariadb, I don't know what's the connection problem.

推荐答案

Mariadb不支持.

Mariadb is not supported.

摘自文档:

在Apps脚本中,JDBC服务支持Google Cloud SQL,MySQL,Microsoft SQL Server和Oracle数据库.

In Apps Script, the JDBC service supports Google Cloud SQL, MySQL, Microsoft SQL Server, and Oracle databases.

如果要将Mariadb与Google Apps脚本一起使用,则需要编写REST API自己分层,以便您可以从Apps脚本向数据库进行简单的UrlFetch调用.该注释链接到 postgrest GitHub存储库作为REST API的示例.

If you want to use Mariadb with Google Apps Script, you will need to write a REST API layer yourself, so that you can make simple UrlFetch calls from Apps Script to your db. That comment links to the postgrest GitHub repository as an example of a REST API.

这篇关于使用Google脚本连接到mariadb,错误:连接URL使用了不受支持的JDBC协议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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