very low memory mysql 5 my.cnf configuration

by paragasu

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


More info

About these ads