适用于1GB 内存 VPS上的MySQL5.6配置文件my.cnf

老牛  2015-07-20 23:24  阅读 162 views 次 评论 0 条

点此下载配置文件,zip压缩包,解压后记事本打开

建议其参照参数自行调整,不建议直接覆盖,调整前请备份好原my.cnf

[client]
#password = [your_password]
port = 3306
socket = /tmp/mysql.sock

[mysqld]
port = 3306
socket = /tmp/mysql.sock

socket  = /tmp/mysql.sock
basedir = /usr/local/mysql
datadir = /data/mysql/data
log-error = /data/mysql/mysql_error.log
pid-file = /data/mysql/mysql.pid

#skip_slave_start
skip-name-resolve
back_log = 600
#skip-networking
max_connections = 1000
max_connect_errors = 6000
open_files_limit = 10240
table_open_cache = 64
#external-locking
max_allowed_packet = 4M
binlog_cache_size = 1M
max_heap_table_size = 8M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
sort_buffer_size = 8M
join_buffer_size = 8M
thread_cache_size = 24
thread_concurrency = 24
query_cache_size = 8M
query_cache_limit = 2M
ft_min_word_len = 4
#memlock
default-storage-engine = MyISAM
thread_stack = 192K

# Set the default transaction isolation level. Levels available are:
# READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE
transaction_isolation = REPEATABLE-READ

tmp_table_size = 16M

log-bin = /data/mysql/binlog/binlog
binlog_format=mixed
#log_slave_updates

# Enable the full query log. Every query (even ones with incorrect
# syntax) that the server receives will be logged. This is useful for
# debugging, it is usually disabled in production use.
#log

# Print warnings to the error log file.  If you have any problem with
# MySQL you should enable logging of warnings and examine the error log
# for possible explanations.
#log_warnings

server-id = 1

relay-log-index = /data/mysql/relaylog/relaylogindex
relay-log-info-file = /data/mysql/relaylog/relayloginfo
relay-log = /data/mysql/data/relaylog/relaylog
expire_logs_days = 30

key_buffer_size = 4M
bulk_insert_buffer_size = 4M
myisam_sort_buffer_size = 8M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover
#skip-innodb
innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 16M
innodb_data_file_path = ibdata1:10M:autoextend
#innodb_data_home_dir = <directory>
innodb_write_io_threads = 4
innodb_read_io_threads = 4
#innodb_force_recovery=1
innodb_thread_concurrency = 4

# If set to 1, InnoDB will flush (fsync) the transaction logs to the
# disk at each commit, which offers full ACID behavior. If you are
# willing to compromise this safety, and you are running small
# transactions, you may set this to 0 or 2 to reduce disk I/O to the
# logs. Value 0 means that the log is only written to the log file and
# the log file flushed to disk approximately once per second. Value 2
# means the log is written to the log file at each commit, but the log
# file is only flushed to disk approximately once per second.
innodb_flush_log_at_trx_commit = 1

#innodb_fast_shutdown
innodb_log_buffer_size = 2M
innodb_log_file_size = 32M
innodb_log_files_in_group = 3
#innodb_log_group_home_dir
innodb_max_dirty_pages_pct = 90
#innodb_flush_method=O_DSYNC
innodb_lock_wait_timeout = 120

interactive_timeout = 86400
wait_timeout = 86400


[mysqldump]
quick
max_allowed_packet = 8M

[mysql]
no-auto-rehash
#safe-updates

[myisamchk]
key_buffer_size = 8M
sort_buffer_size = 8M
read_buffer = 4M
write_buffer = 4M

[mysqlhotcopy]
interactive-timeout

[mysqld_safe]
open-files-limit = 10240
本文地址:http://xiaohost.com/1173.html
版权声明:本文为原创文章,版权归 老牛 所有,欢迎分享本文,转载请保留出处!

发表评论


表情