mysql 配置

Last updated on September 15, 2024 pm

🧙 Questions

mysql配置文件说明

☄️ Ideas

默认路径为:/etc/mysql/conf.d/my.cnf

sudo vim /data/mysql/conf.d/my.cnf
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

#
# The MySQL  Server configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

[mysqld]
pid-file  = /var/run/mysqld/mysqld.pid
socket    = /var/run/mysqld/mysqld.sock
datadir   = /var/lib/mysql

# 默认服务器字符集
character_set_server = utf8mb4

# 数据库时区
default-time-zone='+08:00'

# 最大连接数
max_connections = 1000

# 任何文件目录禁止导出
# 为空 任何都可以导入
# 指定路径,则是某个路径可以导入
secure-file-priv= NULL

# 开启 binlog
log_bin = /var/lib/mysql/mysql-bin
binlog_format = ROW # 选择 ROW 模式
expire_logs_days = 30
server_id = 1 # 配置 MySQL replaction需要定义,不要和canal的slaveId 重复

[mysql]

# 建表默认字符集
default-character-set = utf8mb4
 
# Custom config should go here
!includedir /etc/mysql/conf.d/

mysql 配置
https://ispong.isxcode.com/db/mysql/mysql 配置/
Author
ispong
Posted on
June 29, 2022
Licensed under