linux-tutorial/codes/linux/soft/config/mysql/my.cnf
2019-11-27 13:34:49 +08:00

49 lines
1.4 KiB
INI

# -------------------------------------------------------------------------------
# Mysql 基本配置模板
# -------------------------------------------------------------------------------
[mysqld]
# GENERAL
# -------------------------------------------------------------------------------
server_id = 2
datadir = /var/lib/mysql
socket = /var/lib/mysql/mysql.sock
pid_file = /var/lib/mysql/mysql.pid
user = mysql
port = 3306
default_storage_engine = InnoDB
default_time_zone = '+8:00'
character_set_server = utf8mb4
collation_server = utf8mb4_0900_ai_ci
# LOG
# -------------------------------------------------------------------------------
log_error = /var/log/mysql/mysql-error.log
slow_query_log = 1
slow_query_log_file = /var/log/mysql/mysql-slow.log
long_query_time = 3
min_examined_row_limit = 100
expire_logs_days = 7
# InnoDB
# -------------------------------------------------------------------------------
innodb_buffer_pool_size = 4G
innodb_log_file_size = 128M
innodb_file_per_table = 1
innodb_flush_method = O_DIRECT
# MyIsam
# -------------------------------------------------------------------------------
key_buffer_size = 256M
# OTHER
# -------------------------------------------------------------------------------
tmp_table_size = 32M
max_heap_table_size = 32M
max_connections = 10000
open_files_limit = 65535
[client]
socket = /var/lib/mysql/mysql.sock
port = 3306