Mysql from the service configuration file, mysql service configuration file
[Mysql]
Port = 3306
Socket =/var/lib/mysql. sock
Default-character-set = utf8mb4
[Mysqld]
Server-id = 2
Log-bin = mysql-bin
Datadir =/data/mysql
Socket =/var/lib/mysql. sock
# Read-only = 1
Binlog_format = mixed
Slave_skip_errorrs = 1062
Slow_query_log
Slow_query_log_file =/data/mysql/slow. log
Long_query_time = 5
Wait_timeout = 86400
Interactive_timeout = 86400
Max_connections = 1000
Max_user_connection= 1000
Max_connect_errors = 20
Character_set_server = utf8
Skip-external-locking
Key_buffer_size = 512 M
Max_allowed_packet = 512 M
Table_open_cache = 500
Sort_buffer_size = 512 M
Read_buffer_size = 512 M
Read_rnd_buffer_size = 512 M
Myisam_sort_buffer_size = 512 M
Thread_cache_size = 32
Query_cache_size = 512 M
# Binlog-ignore-db = mysql
Binlog-ignore-db = information_schema
# Replicate_ignore_db = mysql
Replicate_ignore_db = information_schema
Expire-logs-days = 10
# Skip-slave-start
Skip-name-resolve
Lower_case_table_names = 1
Log_bin_trust_function_creators = 1
# Innodb_data_home_dir =/data/mysql/data
# Innodb_log_group_home_dir =/data/mysql/logs
Innodb_data_file_path = ibdata1: 20 M: autoextend
Innodb_buffer_pool_size = 48G
Innodb_log_file_size = 512 M
Innodb_log_buffer_size = 512 M
Innodb_lock_wait_timeout = 50
# Innodb_file_per_table
Innodb_flush_log_at_trx_commit = 1
Explicit_defaults_for_timestamp = true
SQL _mode = STRICT_TRANS_TABLES, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION, NO_AUTO_VALUE_ON_ZERO
Symbolic-links = 0
# Recommended in standard MySQL setup
# SQL _mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES
Event_scheduler = 1
[Mysqld_safe]
Log-error =/var/log/mysqld. log
Pid-file =/var/run/mysqld. pid