my.cnf 配置文件

[root@0-17 mysql]# cat /home/mysql_config/my.cnf
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /usr/local/mysql/data) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
#password       = your_password
port            = 3306
socket          = /home/mysql_config/tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
connect_timeout = 20
basedir         = /usr/local/webserver/mysql/
datadir         = /home/mysqldata
user            = mysql

port            = 3306
socket          = /home/mysql_config/run/mysqld.sock
pid-file        = /home/mysql_config/run/mysql.pid
default-character-set = utf8
back_log        = 500
event_scheduler = OFF
expire_logs_days= 7

log-error =/home/mysql_config/log/performance-mysql.err

skip-name-resolve
#default_table_type = Innodb
innodb_file_format=Barracuda

max_connections         = 1100
max_connect_errors      = 100000


table_cache             = 2048

table_open_cache      = 6144
table_definition_cache  = 4096
wait_timeout=600
interactive_timeout = 600


tmpdir                  = /home/mysql_config/tmp
tmp_table_size          = 16M
max_heap_table_size     = 16M

thread_cache_size       = 64
thread_concurrency      = 32
thread_stack            = 192K

max_allowed_packet      = 16M

sort_buffer_size        = 512K
join_buffer_size        = 1M
query_cache_size        = 0
#query_cache_limit       = 2M
key_buffer_size         = 16M
read_buffer_size        = 512k
read_rnd_buffer_size    = 512k
bulk_insert_buffer_size = 16M

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication

binlog_format           = mixed
binlog_cache_size       = 1M
log-bin                 = /home/mysql_config/log/mysql-bin
max_binlog_size         = 128M

log_long_format
#slow_query_log_file     = mysql.slow
#log_queries_not_using_indexes   = 0
long_query_time                 = 1
log-slow-queries=/home/mysql_config/log/performance-slow.log

myisam_sort_buffer_size         = 32M
myisam_max_sort_file_size       = 512M
myisam_max_extra_sort_file_size = 512M
myisam_repair_threads           = 1
myisam_recover


#SLAVE
server-id = 120
#master-host = 192.168.0.6
#master-user = slave
#master-password = slave
#master-port = 3306
#replicate-ignore-table=mysql.inventory
#replicate-ignore-db=mysql
#replicate-ignore-table=mysql.user
#slave-net-timeout=35
#master-connect-retry=30
#relay-log = /home/ktep/mysql/logs/relay-bin
#max-relay-log-size = 128M
#log_slave_updates
#replicate-same-server-id=0
#skip-slave-start
#slave_skip_errors =1032
##slave_skip_errors = all
#read-only=1



#transaction_isolation = READ-COMMITTED
innodb_flush_method     = O_DIRECT

innodb_buffer_pool_size         = 32G   ###这个参数很重要,占总内存的%70-%80
innodb_additional_mem_pool_size = 16M

innodb_data_home_dir    = /home/mysql_config/data

innodb_data_file_path  = ibdata1:10M:autoextend
innodb_file_per_table = 1

innodb_log_group_home_dir = /home/mysql_config/log
innodb_log_buffer_size    = 64M
innodb_log_file_size      = 256M
innodb_log_files_in_group = 3

innodb_thread_concurrency = 288
innodb_thread_sleep_delay = 500
innodb_file_io_threads    = 4
innodb_concurrency_tickets = 1000

innodb_adaptive_hash_index = 1
innodb_adaptive_flushing = 1
innodb_doublewrite = 1
innodb_sync_spin_loops = 40
innodb_io_capacity = 500
innodb_flush_log_at_trx_commit  = 0
innodb_max_dirty_pages_pct      = 80
#innodb_lock_wait_timeout        = 120
innodb_lock_wait_timeout        = 10
innodb_support_xa               = 0

log_bin_trust_function_creators = 1


[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

你可能感兴趣的:(数据库-mysql)