我正在使用GOOGLE中的代码使用正确的参数远程连接到mariadb。
// 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协议。
似乎我无法连接到Mariadb,我不知道连接问题是什么。
答案 0 :(得分:1)
不支持Mariadb。
在Apps脚本中,JDBC服务支持Google Cloud SQL,MySQL,Microsoft SQL Server和Oracle数据库。
如果您想将Mariadb与Google Apps脚本一起使用,则需要write a REST API layer yourself, so that you can make simple UrlFetch calls from Apps Script to your db。该注释链接到postgrest GitHub存储库作为REST API的示例。