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

Original ๐Ÿ“‹ Debian 13 (Trixie) 28 lines

Works On

Viewing:
Debian 13 (Trixie)
Same on:
Debian 11 (Bullseye) Debian 12 (Bookworm) Ubuntu 22.04 LTS (Jammy Jellyfish) Ubuntu 24.04 LTS (Noble Numbat)
Other versions:

Details

Size
28 lines
MD5
ae130218a23989c3a504c95831610b4b
SHA256
bfc648f510483468aeefdd9256089a89e278d06b19945c368e4e846fe53797e1

Copy & Paste

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

For AI Agents

You are a DevOps agent. Fetch the default MariaDB config for Debian 13 (Trixie) from https://exampleconfig.com/api/v1/config/original/ae130218a23989c3a504c95831610b4b?hint=50-mysqld_safe.cnf. Compare with my current /etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf and summarize differences and safe changes.

Copy this prompt into Claude, ChatGPT, or other AI assistants.

/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 behavior, 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...

nice = 0
skip_log_error
syslog

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?

Restore it. Compare it. Start clean.

How do I restore MariaDB defaults?

Download, replace, restart.

Is 50-mysqld_safe.cnf safe for production?

Yes. This is exactly what shipped. Safe starting point.

How does this differ from other OS versions?

Defaults change. This one is specific to Debian 13 (Trixie).

Can I use this for MariaDB troubleshooting?

Absolutely. Diff this against yours to spot the problem.