小内存VPS如何配置Mysql

默认配置下mysql对于小内存的VPS来说是很耗费内存的。
按以下配置文件,可减少约100M内存开销

小内存VPS MySql配置文件修改如下(配置文件一般在/etc/my.cnf or /etc/mysql/my.cnf)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[mysqld]
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K
skip-innodb

# this option may not work - if it doesn't simply omit it.
# known not to work in ubuntu 9.10, and likely other recent distributions as well.
skip-bdb
原文链接:https://xiaohost.com/1115.html,转载请注明出处。
0

评论0

请先