This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Setting up MariaDB

The following sections describe how to set up MariaDB to replace the default H2 database in your WSO2 product

Setting up the database and users

Follow the steps given below to set up MariaDB. See Tested DBMSs for information on the MariaDB versions that are tested with WSO2 products.

  1. Download, install and start MariaDB on your computer. See https://downloads.mariadb.org/.

    You can install MariaDB standalone or as a galera cluster for high availability. Database clustering is independent of WSO2 product clustering.

    For instructions on installing MariaDB on MAC OS, go to Homebrew.

  2. Log in to MariaDB as the root user (or any other user with database creation privileges).

    mysql -u root -p
  3. Enter the password when prompted.

    In most systems, there is no default root password. Press the Enter key without typing anything if you have not changed the default root password.

  4. In the MySQL command prompt, create the database using the following command:

    create database regdb;
  5. Give authorization to the regadmin user as follows:

    GRANT ALL ON regdb.* TO regadmin@localhost IDENTIFIED BY "regadmin";
  6. Once you have finalized the permissions, reload all the privileges by executing the following command: 

    FLUSH PRIVILEGES;
  7. Log out from the MySQL prompt by executing the following command:

    quit;

Setting up the drivers

Download the MySQL Java connector JAR file, and copy it to the <PRODUCT_HOME>/repository/components/lib/ directory.

Note  that you must  use the MySQL connector that is compatible with your MariaDB version. For example,  mysql-connector-java-5.1.36-bin.jar is compatible with MariaDB version 10.0.20. See Tested DBMSs for information on the WSO2 products that have been tested for compatibility with different versions of MariaDB and MySQL connectors.

What's next

By default, all WSO2 products are configured to use the embedded H2 database. To configure your product with MariaDB, see Changing to MariaDB.