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

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

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
[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
原文链接:https://xiaohost.com/10682.html,转载请注明出处。
0

评论0

请先