documentation/Reference/Database Driver Reference/MariaDB.md
{% include database-boilerplate.html %}
| Item | Details |
|---|---|
| URL format | <code>jdbc:mysql://<i>host</i>:<i>port</i>/<i>database</i></code> |
| or | |
| <code>jdbc:mariadb://<i>host</i>:<i>port</i>/<i>database</i></code> | |
| SSL support | Yes - add ?useSsl=true |
| Ships with Flyway Command-line | Yes |
| Maven Central coordinates | org.mariadb.jdbc:mariadb-java-client |
| Supported versions | 2.0.0 and later |
| Default Java class | org.mariadb.jdbc.Driver |
MariaDB support is a separate dependency for Flyway and will need to be added to your Java project to access these features.
MariaDB is found within the flyway-mysql plugin module.
<dependency>
<groupId>com.redgate.flyway</groupId>
<artifactId>flyway-mysql</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-mysql</artifactId>
</dependency>
buildscript {
dependencies {
implementation "com.redgate.flyway:flyway-mysql"
}
}
buildscript {
dependencies {
implementation "org.flywaydb:flyway-mysql"
}
}
/* Single line comment */
CREATE TABLE test_data (
value VARCHAR(25) NOT NULL,
PRIMARY KEY(value)
);
/*
Multi-line
comment
*/
-- MySQL procedure
DELIMITER //
CREATE PROCEDURE AddData()
BEGIN
# MySQL-style single line comment
INSERT INTO test_data (value) VALUES ('Hello');
END //
DELIMITER;
CALL AddData();
-- MySQL comments directives generated by mysqlsump
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-- Placeholder
INSERT INTO ${tableName} (name) VALUES ('Mr. T');