MariaDB /etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf

Original 📋 Debian 10 (Buster) 30 lines

Works On

Viewing:
Debian 10 (Buster)
Same on:
Debian 9 (Stretch) Ubuntu 18.04 LTS (Bionic Beaver) Ubuntu 20.04 LTS (Focal Fossa)
Other versions:

Details

Size
30 lines
MD5
ace3390ea785e7bb3e87bee2ef0f9da8
SHA256
c294caa43f63dc6328ebf7c00edc12502a5604ca3775589f631b27d7a6e4acaa
/etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf
# NOTE: This file is read only by the traditional SysV init script, not systemd.
# MariaDB systemd does _not_ utilize mysqld_safe nor read this file.
#
# For similar behaviour, systemd users should create the following file:
# /etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf
#
# To achieve the same result as the default 50-mysqld_safe.cnf, please create
# /etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf
# with the following contents:
#
# [Service]
# User=mysql
# StandardOutput=syslog
# StandardError=syslog
# SyslogFacility=daemon
# SyslogLevel=err
# SyslogIdentifier=mysqld
#
# For more information, please read https://mariadb.com/kb/en/mariadb/systemd/
#

[mysqld_safe]
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# especially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
socket		= /var/run/mysqld/mysqld.sock
nice		= 0
skip_log_error
syslog

Copy & Paste

curl:
curl https://exampleconfig.com/api/v1/config/original/ace3390ea785e7bb3e87bee2ef0f9da8?hint=50-mysqld_safe.cnf
wget:
wget -O 50-mysqld_safe.cnf https://exampleconfig.com/api/v1/config/original/ace3390ea785e7bb3e87bee2ef0f9da8?hint=50-mysqld_safe.cnf

For AI Agents

<prompt><role>DevOps agent</role><source url='https://exampleconfig.com/api/v1/config/original/ace3390ea785e7bb3e87bee2ef0f9da8?hint=50-mysqld_safe.cnf' /><config><app>MariaDB</app><os>Debian 10 (Buster)</os><location>/etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf</location><lines>30</lines><md5>ace3390ea785e7bb3e87bee2ef0f9da8</md5><sha256>c294caa43f63dc6328ebf7c00edc12502a5604ca3775589f631b27d7a6e4acaa</sha256></config></prompt>

Paste into Claude, ChatGPT, or any AI assistant.

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

File Location

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

FAQ

When should I use this 50-mysqld_safe.cnf?

Use it to restore a missing default, confirm what shipped, or diff against your current MariaDB config.

How do I restore MariaDB defaults?

Download the file, back up the current one in /etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf, replace it, then reload or restart MariaDB.

Is 50-mysqld_safe.cnf safe for production?

It is the vendor default for Debian 10 (Buster). Treat it as a baseline and review security and performance settings before production use.

How does this differ from other OS versions?

Defaults vary by distro and version. This copy matches Debian 10 (Buster).

Can I use this for MariaDB troubleshooting?

Yes. Diff it against yours to find drift, then restore only the sections you need.