Can MariaDB settings be customized on Synology NAS?

Can MariaDB settings be customized on Synology NAS?

Purpose

When managing a database in DSM 5.0 or above, the default settings of the MariaDB package should meet the requirements of its users. This article guides you through how to manually change the MariaDB settings based on your preference.

Resolutions

  1. Sign in to DSM via SSH.1
  2. Edit the file my.cnf located in the MariaDB folder. This file should include the settings you want to change in MariaDB.
    • MariaDB 5: /var/packages/MariaDB/etc
    • MariaDB 10: /var/packages/MariaDB10/etc

    If my.cnf does not exist in the MariaDB folder, create a configuration file named my.cnf.

  3. To apply the new settings, restart your Synology NAS or execute the command. After an update of the MariaDB package or a DSM restart, the new settings will be retained.
    • MariaDB 5: /usr/syno/bin/synopkg restart MariaDB
    • MariaDB 10: /usr/syno/bin/synopkg restart MariaDB10

    For example, to increase the maximum size of incoming files in MariaDB, you can add the following lines in the my.cnf configuration file:

    [mysqld]
    max_allowed_packet = 1073741824

Notes:

  1. Refer to this article to learn how to sign in with root permission via SSH/Telnet.