小内存VPS如何配置Mysql

老牛  2015-07-12 15:53  阅读 129 views 次 评论 0 条

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

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

[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
本文地址:http://xiaohost.com/1115.html
版权声明:本文为原创文章,版权归 老牛 所有,欢迎分享本文,转载请保留出处!

发表评论


表情