0
点赞
收藏
分享

微信扫一扫

MySQL 5.5 My.cnf 模版

摘要:
      按照上一篇​文章的信息,对MySQL5.5的my.cnf 进行了配置(Slave服务器):

my.cnf:

[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
# * Basic Settings
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp

local-infile = 0
skip-external-locking
skip-name-resolve

character-set-server = UTF8
default-storage-engine=INNODB

bind-address = 192.168.100.1
back_log = 500
thread_stack = 192K

#ignore-builtin-innodb
#plugin-load=innodb=ha_innodb_plugin.so;innodb_trx=ha_innodb_plugin.so;innodb_locks=ha_innodb_plugin.so;innodb_cmp=ha_innodb_plugin.so;innodb_cmp_reset=ha_innodb_plugin.so;innodb_cmpmem=ha_innodb_plugin.so;innodb_cmpmem_reset=ha_innodb_plugin.so;INNODB_LOCK_WAITS=ha_innodb_plugin.so

max_allowed_packet = 32M
max_connections = 600
max_connect_errors = 2000
max_heap_table_size = 512M
max_length_for_sort_data= 2048
tmp_table_size = 512M

read_buffer_size = 512K
read_rnd_buffer_size = 1M
sort_buffer_size = 512K
#join_buffer_size = 256K

table_open_cache = 1024
thread_cache_size = 64

# * Query Cache Configuration
query_cache_type = 0
query_cache_size = 0M
query_cache_limit = 1M


# * Logging and Replication
log_error = /var/log/mysql/error_3306.log
log_slow_queries = /var/log/mysql/mysql-slow-3306.log
long_query_time = 2
#log-queries-not-using-indexes

# * other settings you may need to change.

#log_bin = /var/log/mysql/mysql-bin-3306.log
#log_bin = mysql-bin-3306.log
#binlog_cache_size = 1M
#max_binlog_size = 500M
#binlog_format = MIXED
#sync_binlog = 8
#expire_logs_days = 3

server-id = 3

relay_log = mysqld-relay-bin

# * MyISAM
key_buffer_size = 64M
bulk_insert_buffer_size = 8M
concurrent_insert = 2
myisam-recover = BACKUP

# * InnoDB
#innodb_strict_mode = 1
innodb_buffer_pool_size = 8000M
innodb_additional_mem_pool_size = 15M
innodb_file_per_table = 1
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 8M
innodb_log_file_size = 64M
innodb_log_files_in_group = 2
innodb_max_dirty_pages_pct = 60

innodb_read_io_thread = 8
innodb_write_io_thread = 8
innodb_io_capacity = 500

innodb_adaptive_flushing = 1
innodb_old_blocks_pct = 37
innodb_old_blocks_time = 1000

innodb_buffer_pool_instances = 3

innodb_use_native_aio = 1
innodb_use_sys_malloc = 1
innodb_thread_concurrency = 0

innodb_purge_threads = 1
innodb_purge_batch_size = 300

innodb_change_buffering = all
innodb_file_format = barracuda
innodb_file_format_check = 1
innodb_file_format_max = barracuda
innodb_stats_on_metadata = 0

innodb_open_files = 2000
innodb_flush_method = O_DIRECT

lock_wait_timeout = 50

#transaction-isolation = READ-COMMITTED

# * replication
replicate_do_db = uc
#binlog_do_db = include_database_name
#skip-slave-start
#log_slave_updates

# * slave
slave_net_timeout = 300
relay_log_recovery = 1
sync_relay_log = 0
sync_relay_log_info = 0
sync_master_info = 0
report-host = 1_3306

[mysqldump]
quick
quote-names
max_allowed_packet = 32M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = 16M

 

~~~~~~~~~~~~~~~ 万物之中,希望至美 ~~~~~~~~~~~~~~~

举报

相关推荐

0 条评论