欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

当服务器内存非常低的时候 my.cnf 的配置 very low memory mysql 5 my.cnf configuration 好像不行

on VPS server with very limited memory it is good to tweak mysql5. In /etc/mysql/my.cnf


# Main MySQL server options
[mysqld]
port = 3306
socket = /var/run/mysqld/mysqld.sock

# No locking at all!
skip-locking

# Set internal buffers, caches and stacks very low
key_buffer = 16K
max_allowed_packet = 16K
table_cache = 1
sort_buffer_size = 16K
read_buffer_size = 16K
read_rnd_buffer_size = 1K
net_buffer_length = 1K
thread_stack = 16K

# Don't listen on a TCP/IP port at all.
# Will still work provided all access is done via localhost
skip-networking
server-id = 1

# Skip Berkley and Inno DB types
skip-bdb
skip-innodb

# Set the query cache low
query_cache_limit = 1048576
query_cache_size = 1048576
query_cache_type = 1

# Set various memory limits very low, disable memory-hogging extras
[mysqldump]
quick
max_allowed_packet = 16K
[mysql]
no-auto-rehash
[isamchk]
key_buffer = 16K
sort_buffer_size = 16K
[myisamchk]
key_buffer = 16K
sort_buffer_size = 16K
[mysqlhotcopy]
interactive-timeout

来自  https://paragasu.wordpress.com/2008/12/02/very-low-memory-mysql-5-mycnf-configuration/

普通分类: