MariaDB /etc/my.cnf

原始 📋 Alpine Linux v3.21 12 行

适用于

当前查看:
Alpine Linux v3.21
相同于:
其他版本:

详情

大小
12 行
MD5
53cd06a8d493f97c8b2aa273767e1a1d
SHA256
266c910fd2da175ceff8f9029db11e2ee5c1028056fcdbef5653bae5227e2dd6
/etc/my.cnf
# This group is read both both by the client and the server
# use it for options that affect everything
[client-server]

# This group is read by the server
[mysqld]

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

# include all files from the config directory
!includedir /etc/my.cnf.d

复制粘贴

curl:
curl https://exampleconfig.com/api/v1/config/original/53cd06a8d493f97c8b2aa273767e1a1d?hint=my.cnf
wget:
wget -O my.cnf https://exampleconfig.com/api/v1/config/original/53cd06a8d493f97c8b2aa273767e1a1d?hint=my.cnf

给 AI Agent 用

<prompt><role>DevOps agent</role><source url='https://exampleconfig.com/api/v1/config/original/53cd06a8d493f97c8b2aa273767e1a1d?hint=my.cnf' /><config><app>MariaDB</app><os>Alpine Linux v3.21</os><location>/etc/my.cnf</location><lines>12</lines><md5>53cd06a8d493f97c8b2aa273767e1a1d</md5><sha256>266c910fd2da175ceff8f9029db11e2ee5c1028056fcdbef5653bae5227e2dd6</sha256></config></prompt>

粘贴到 Claude、ChatGPT 或任何 AI 助手里。

安装 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

文件位置

文件路径
/etc/my.cnf
目录
/etc/
用途
系统级配置目录
说明
/etc/ 里的文件是系统级配置,影响所有用户。

FAQ

什么时候该用这个 my.cnf?

用来恢复缺失的默认文件、确认发行版本带了什么,或拿你的 MariaDB config 做 diff。

怎么恢复 MariaDB 的默认配置?

下载文件,把 /etc/my.cnf 里的当前配置备份好,替换掉,然后 reload 或 restart MariaDB。

my.cnf 适合直接上生产吗?

这是 Alpine Linux v3.21 的厂商默认配置,只能当基线。上生产前请检查安全和性能设置。

和其他 OS 版本有什么不同?

默认值会随发行版和版本变化,这份对应 Alpine Linux v3.21。

我可以用它来排查 MariaDB 吗?

可以。和你的配置做 diff 找出漂移,然后只恢复需要的段落。