mysql下载地址:https://downloads.mysql.com/archives/community/
配置文件:
cat /etc/my.cnf
[client]
port = 3306
socket = /tmp/mysql_3306.sock
[mysql]
prompt="\\u@\h \\R:\\m:\\s [\\d]> "
no-auto-rehash
tee = /data/mysql_3306/logs/tee.log
# mysql.mysql
# /data/mysql_3306/{data, tmp, binlogs, logs}
[mysqld]
server-id = 33066115
port = 3306
socket = /tmp/mysql_3306.sock
basedir = /opt/mysql
datadir = /data/mysql_3306/data
tmpdir = /data/mysql_3306/tmp
open_files_limit = 65535
back_log = 512
max_connections = 250
max_connect_errors = 100000
table_open_cache = 512
external-locking = FALSE
max_allowed_packet = 32M
sort_buffer_size = 4M
join_buffer_size = 4M
thread_cache_size = 512
tmp_table_size = 32M
max_heap_table_size = 32M
query_cache_size = 0
query_cache_type = 0
skip-host-cache
skip_name_resolve = 1
read_buffer_size = 4M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 64M
character-set-server = utf8
lower_case_table_names = 1
long_query_time = 0.05
slow_query_log = 1
slow_query_log_file = /data/mysql_3306/logs/slow.log
log_queries_not_using_indexes =1
min_examined_row_limit = 100
log_slow_admin_statements = 1
log_slow_slave_statements = 1
log-bin = /data/mysql_3306/binlogs/mysql-bin
sync_binlog = 1
binlog_cache_size = 4M
max_binlog_cache_size = 512M
max_binlog_size = 512M
expire_logs_days = 15
binlog_format = row
skip-name-resolve
log_slave_updates
log-error = /data/mysql_3306/logs/error.log
key_buffer_size = 32M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 8G
myisam_repair_threads = 1
default-storage-engine=InnoDB
transaction_isolation = REPEATABLE-READ
innodb_checksums = 1
innodb_additional_mem_pool_size = 16M
# 60%
innodb_buffer_pool_size = 22938M #内存的60%到70%
innodb_flush_method = O_DIRECT
# cores
innodb_write_io_threads = 8 #根据cpu核数修改
innodb_read_io_threads = 8 #根据cpu核数修改
innodb_lock_wait_timeout = 10
innodb_rollback_on_timeout = 1
innodb_print_all_deadlocks = 1
innodb_purge_threads = 1
innodb_io_capacity = 2500
innodb_data_file_path = ibdata1:1024M:autoextend
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 16M
innodb_log_file_size = 1G
innodb_log_files_in_group = 2
innodb_max_dirty_pages_pct = 50
innodb_file_per_table = 1
innodb_locks_unsafe_for_binlog = 0
innodb_support_xa=1
innodb_file_format = Barracuda
innodb_file_format_max = Barracuda
[mysqldump]
quick
max_allowed_packet = 32M
-----------------------------------------------------------------------------------------------------------------
安装: