Documentation

Documentation versions (currently viewingVaadin 23)

Connecting to MariaDB

MariaDB is a popular fork of the relational database MySQL. You should install MariaDB separately before you can connect to it from your Vaadin application (you can also install MariaDB as a Docker container).

For an existing Vaadin project, you can connect to MariaDB by following the steps below:

  1. Add the mariadb-java-client dependency to the pom.xml file.

    <dependency>
        <groupId>org.mariadb.jdbc</groupId>
        <artifactId>mariadb-java-client</artifactId>
        <version>3.0.5</version>
    </dependency>
  2. Add MariaDB configuration properties to the src/main/resources/application.properties file. You will have to replace HOST, PORT, DB_NAME, USERNAME, PASSWORD with corresponding parameters from your MariaDB instance.

    # MariaDB Configuration
    spring.jpa.hibernate.ddl-auto=update
    spring.datasource.url=jdbc:mariadb://HOST:PORT/DB_NAME
    spring.datasource.username=USERNAME
    spring.datasource.password=PASSWORD
    spring.datasource.driver-class-name=org.mariadb.jdbc.Driver