MariaDB /etc/my.cnf

Authentic ๐Ÿ“‹ CentOS Stream 9 32 lines

Compatibility

Currently viewing:
CentOS Stream 9
Also compatible:
Different versions:

File Info

Size
32 lines
MD5
ea34d282649767d69a65a33231244e75
SHA256
1734fab49caed23761597f11d81acd181b14d5beb2e1a88090e6f42cd3c0348d

Quick Commands

curl:
curl https://exampleconfig.com/api/v1/config/original/ea34d282649767d69a65a33231244e75?hint=my.cnf
wget:
wget -O my.cnf https://exampleconfig.com/api/v1/config/original/ea34d282649767d69a65a33231244e75?hint=my.cnf
/etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html

[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove the leading "# " to disable binary logging
# Binary logging captures changes between backups and is enabled by
# default. It's default setting is log_bin=binlog
# disable_log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
#
# Remove leading # to revert to previous value for default_authentication_plugin,
# this will increase compatibility with older clients. For background, see:
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin
# default-authentication-plugin=mysql_native_password

datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

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/my.cnf
Directory
/etc/
Significance
System-wide configuration directory
Description
Files in /etc/ contain system-wide configuration settings that affect all users.

Complete MariaDB Configuration Guide

What is my.cnf?
Get the original 'my.cnf' configuration file for MariaDB from a clean CentOS Stream 9 installation. This is the factory-default configuration for the popular MySQL-compatible database, perfect for migration planning, performance tuning, and understanding MariaDB-specific optimizations.
Technical Details
Found at '/etc/my.cnf', this 32-line file includes Aria storage engine settings, enhanced MyISAM performance, improved replication features, and advanced security options. Used by Wikipedia, Google, and millions of applications requiring high-performance database operations.
Common Configuration Question
How do you configure MariaDB for optimal performance and what are the key differences from MySQL on CentOS Stream 9?
Why Use This Configuration?
This default configuration showcases MariaDB's enhanced features including better thread handling, improved optimizer, and additional storage engines. Essential for database administrators and developers migrating from MySQL or building new applications.

Frequently Asked Questions

When should I use this my.cnf file?

Use this original configuration file when you need to restore MariaDB to its default state after misconfiguration, during fresh installations, or as a baseline for customization. It's particularly useful for troubleshooting when your current config isn't working properly.

How do I restore MariaDB to default settings?

Download this file and replace your current configuration at /etc/my.cnf. Make sure to backup your existing configuration first, then restart the MariaDB service to apply the changes.

Is this my.cnf file secure for production use?

This is the factory-default configuration that ships with MariaDB on CentOS Stream 9. While it provides a secure baseline, you should review and customize security settings based on your specific production requirements and compliance needs.

What's the difference between this and other OS versions?

This configuration is specifically from CentOS Stream 9. Different operating systems and versions may have slightly different default settings, security patches, or feature availability. Check the compatibility section above for other OS versions.

Can I use this configuration file for MariaDB troubleshooting?

Yes, this original configuration is excellent for troubleshooting. Compare it with your current settings to identify modifications that might be causing issues, or temporarily replace your config with this one to isolate problems.