MySQL 参数整理-阿里云开发者社区

开发者社区> 数据库> 正文

MySQL 参数整理

简介: [client] socket = /testdb/my3332/var/mysql.sockport = 3332[mysqld.
[client]                           
socket                             = /testdb/my3332/var/mysql.sock
port                               = 3332
[mysqld]

############# GENERAL #############
autocommit                         = ON
character_set_server               = UTF8MB4
collation_server                   = UTF8MB4_BIN
explicit_defaults_for_timestamp    = ON  
lower_case_table_names             = 1
port                               = 3332
read_only                          = ON
transaction_isolation              = READ-COMMITTED

####### CACHES AND LIMITS #########
interactive_timeout                = 600
lock_wait_timeout                  = 50
max_allowed_packet                 = 32M
max_connect_errors                 = 10000
max_connections                    = 800
max_user_connections               = 400
sort_buffer_size                   = 1M
table_definition_cache             = 1400
table_open_cache                   = 5000 
table_open_cache_instances         = 4
thread_cache_size                  = 9
thread_stack                       = 256K
tmp_table_size                     = 32M

############# SAFETY ##############
local_infile                       = OFF
plugin-load                        = validate_password.so
skip_name_resolve                  = ON
sql_mode                           = STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY

############# LOGGING #############
general_log                        = 0
log_queries_not_using_indexes      = ON
log_slow_admin_statements          = ON
log_warnings                       = 2
long_query_time                    = 1
slow_query_log                     = ON

############# REPLICATION #############
binlog_checksum                    = CRC32
binlog_format                      = ROW
binlog_rows_query_log_events       = ON
enforce_gtid_consistency           = ON
expire_logs_days                   = 7
gtid_mode                          = ON
log_slave_updates                  = ON
master_info_repository             = TABLE
master_verify_checksum             = ON
max_binlog_size                    = 256M
relay_log_info_repository          = TABLE
server_id                          = 4061333332
skip_slave_start                   = ON
slave_net_timeout                  = 4
slave_sql_verify_checksum          = ON
sync_binlog                        = 1
sync_master_info                   = 10000
sync_relay_log                     = 10000
sync_relay_log_info                = 10000
rpl_semi_sync_master_enabled       = 1
rpl_semi_sync_slave_enabled        = 1
rpl_semi_sync_master_timeout       = 1000

############### PATH ##############
basedir                            = /testdb/mysql/5.6.22

datadir                            = /testdb/my3332/data
tmpdir                             = /testdb/my3332/tmp
socket                             = /testdb/my3332/var/mysql.sock
pid_file                           = /testdb/my3332/var/mysql.pid
innodb_data_home_dir               = /testdb/my3332/data

log_error                          = /testdb/my3332/log/error.log
general_log_file                   = /testdb/my3332/log/general.log
slow_query_log_file                = /testdb/my3332/log/slow.log

log_bin                            = /testdb/my3332/log/mysql-bin
log_bin_index                      = /testdb/my3332/log/mysql-bin.index
relay_log                          = /testdb/my3332/log/relay-log
relay_log_index                    = /testdb/my3332/log/relay-log.index

############# INNODB #############
innodb_file_format                 = Barracuda
innodb_flush_method                = O_DIRECT
innodb_buffer_pool_size            = 10000M
innodb_log_file_size               = 256M
innodb_log_files_in_group          = 4
innodb_flush_log_at_trx_commit     = 1
innodb_support_xa                  = ON
innodb_strict_mode                 = ON
innodb_data_file_path              = ibdata1:256M;ibdata2:16M:autoextend
innodb_checksum_algorithm          = strict_crc32
innodb_io_capacity                 = 180
innodb_lock_wait_timeout           = 5

[mysql]
############# CLIENT #############                            
max_allowed_packet                 = 32M
socket                             = /testdb/my3332/var/mysql.sock
[mysqldump]                        
max_allowed_packet                 = 32M

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

分享:
数据库
使用钉钉扫一扫加入圈子
+ 订阅

分享数据库前沿,解构实战干货,推动数据库技术变革

其他文章