Configuring MariaDB server

You can custom configure the MariaDB database by configuring the MariaDB server with the option files. The default MariaDB option file is called my.cnf on Unix-like operating systems.

  1. SSH into the database server host as a root user.
  2. Open the my.cnf file for editing in an editor such as vi or nano:
    On RHEL/CentOS/SLES:
    vi /etc/my.cnf
    On Debian/Ubuntu:
    vi /etc/mysql/my.cnf
  3. Ensure that the bind-address property is set to 0.0.0.0 or is commented out in case of a default value.
    bind-address=0.0.0.0
  4. Ensure that the default-storage-engine property is set to innodb.
    [mysqld]
    default-storage-engine=innodb
  5. Ensure that the sql_mode property is set to STRICT_ALL_TABLES to avoid columns being truncated during migration.
    sql_mode=STRICT_ALL_TABLES
  6. Save the file and exit.
  7. Restart the database server.
  8. Enable the database server to automatically start on system boot:
    On RHEL/CentOS:
    sudo systemctl enable mariadb
    On SLES:
    sudo systemctl enable mariadb
    On Ubuntu, MariaDB starts automatically after installation. Run the following command to check the status:
    sudo systemctl status mariadb
    On Debian, MariaDB starts automatically after installation. Run the following command to check the status:
    sudo systemctl status mariadb