Back to search

MySQL/MariaDB config

config database

MySQL/MariaDB server custom configuration

/etc/mysql/conf.d/custom.cnf

Required Packages

sudo apt install -y mariadb-server

Server Settings [mysqld]

0.0.0.0 for all interfaces, 127.0.0.1 for local only

Default: 151

Recommended: 50-70% of available RAM for dedicated DB server

Maximum size of a single packet (e.g. 64M)

Larger values improve write performance

Generated Config — /etc/mysql/conf.d/custom.cnf

[mysqld] bind-address = 127.0.0.1 port = 3306 max_connections = 151 innodb_buffer_pool_size = 128M character-set-server = utf8mb4 collation-server = utf8mb4_general_ci