MariaDB /etc/mysql/mariadb.cnf

Authentic ๐Ÿ“‹ Ubuntu 24.04 LTS (Noble Numbat) 29 lines

Compatibility

Currently viewing:
Ubuntu 24.04 LTS (Noble Numbat)
Also compatible:
Debian 11 (Bullseye) Debian 12 (Bookworm) Debian 13 (Trixie) Ubuntu 22.04 LTS (Jammy Jellyfish)
Different versions:

File Info

Size
29 lines
MD5
f78499dd07dccc3238cc15dd937b87bb
SHA256
65084b5344fcbae09425c648a9bfb1ff99c1fd0d83f1eff5bc08bf8032de8981

Quick Commands

curl:
curl https://exampleconfig.com/api/v1/config/original/f78499dd07dccc3238cc15dd937b87bb?hint=mariadb.cnf
wget:
wget -O mariadb.cnf https://exampleconfig.com/api/v1/config/original/f78499dd07dccc3238cc15dd937b87bb?hint=mariadb.cnf
/etc/mysql/mariadb.cnf
# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 0. "/etc/mysql/my.cnf" symlinks to this file, reason why all the rest is read.
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# If you are new to MariaDB, check out https://mariadb.com/kb/en/basic-mariadb-articles/

#
# This group is read both by the client and the server
# use it for options that affect everything
#
[client-server]
# Port or socket location where to connect
# port = 3306
socket = /run/mysqld/mysqld.sock

# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

How to Install MariaDB

Alpine Linux

sudo apk add mariadb

Debian

sudo apt update && sudo apt install mariadb-server

Red Hat Enterprise Linux

sudo yum install mariadb-server

Ubuntu

sudo apt update && sudo apt install mariadb-server

Configuration File Location

File Path
/etc/mysql/mariadb.cnf
Directory
/etc/mysql/
Significance
System-wide configuration directory
Description
Files in /etc/ contain system-wide configuration settings that affect all users.

Quick Answers

When should I use this mariadb.cnf?

Use this file to restore MariaDB defaults after misconfiguration, for fresh installations, or as a customization baseline. Ideal for troubleshooting when your current config causes issues.

How do I restore MariaDB defaults?

Download this file, backup your current config, then replace /etc/mysql/mariadb.cnf. Restart MariaDB service to apply changes.

Is mariadb.cnf safe for production?

This is the factory default from MariaDB on Ubuntu 24.04 LTS (Noble Numbat). Safe baseline for production, but review security settings and customize for your specific requirements first.

How does this differ from other OS versions?

This config is from Ubuntu 24.04 LTS (Noble Numbat). Other OS versions may have different defaults, security patches, or features. Check compatibility section above for alternative versions.

Can I use this for MariaDB troubleshooting?

Yes, compare this original config with your current settings to identify problematic modifications. You can also temporarily replace your config with this one to isolate issues.