Reputation: 13
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);
}
then I got the error: Connection URL uses an unsupported JDBC protocol.
it seems that i cannot connect to Mariadb, I don't know what's the connection problem.
Upvotes: 1
Views: 4271
Reputation: 9872
Mariadb is not supported.
In Apps Script, the JDBC service supports Google Cloud SQL, MySQL, Microsoft SQL Server, and Oracle databases.
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.
Upvotes: 1