2019-11-27 13:34:49 +08:00
|
|
|
# -------------------------------------------------------------------------------
|
|
|
|
# Mysql 基本配置模板
|
|
|
|
# -------------------------------------------------------------------------------
|
|
|
|
|
2019-11-26 17:11:53 +08:00
|
|
|
[mysqld]
|
2019-11-27 13:34:49 +08:00
|
|
|
# GENERAL
|
|
|
|
# -------------------------------------------------------------------------------
|
|
|
|
server_id = 2
|
2019-11-26 17:11:53 +08:00
|
|
|
datadir = /var/lib/mysql
|
|
|
|
socket = /var/lib/mysql/mysql.sock
|
2019-11-27 13:34:49 +08:00
|
|
|
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
|
2019-11-26 17:11:53 +08:00
|
|
|
|
2019-11-27 13:34:49 +08:00
|
|
|
# LOG
|
|
|
|
# -------------------------------------------------------------------------------
|
2020-04-03 15:15:02 +08:00
|
|
|
log_error = /var/log/mysql/mysql.log
|
2019-11-27 13:34:49 +08:00
|
|
|
slow_query_log = 1
|
2020-04-03 15:15:02 +08:00
|
|
|
slow_query_log_file = /var/log/mysql/mysql_slow_query_log.log
|
2019-11-27 13:34:49 +08:00
|
|
|
long_query_time = 3
|
|
|
|
min_examined_row_limit = 100
|
|
|
|
expire_logs_days = 7
|
2019-11-26 17:11:53 +08:00
|
|
|
|
2019-11-27 13:34:49 +08:00
|
|
|
# InnoDB
|
2019-11-26 17:11:53 +08:00
|
|
|
# -------------------------------------------------------------------------------
|
2019-11-27 13:34:49 +08:00
|
|
|
innodb_buffer_pool_size = 4G
|
|
|
|
innodb_log_file_size = 128M
|
|
|
|
innodb_file_per_table = 1
|
|
|
|
innodb_flush_method = O_DIRECT
|
2019-11-26 17:11:53 +08:00
|
|
|
|
2019-11-27 13:34:49 +08:00
|
|
|
# MyIsam
|
|
|
|
# -------------------------------------------------------------------------------
|
|
|
|
key_buffer_size = 256M
|
2019-11-26 17:11:53 +08:00
|
|
|
|
2019-11-27 13:34:49 +08:00
|
|
|
# OTHER
|
2019-11-26 17:11:53 +08:00
|
|
|
# -------------------------------------------------------------------------------
|
2019-11-27 13:34:49 +08:00
|
|
|
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
|