MySQL Server 5.6 512MB RAM

Overview

Ubuntu 14.04 added MySQL 5.6 to the official repository but it turns out installing it on anything less than 1GB RAM is pretty difficult.

Disable Service Startup

It is necessary to disable service startup after an install to prevent apt-get from treating it as a install failure.

Create the file /usr/sbin/policy-rc.d and paste the following:

#!/bin/sh
exit 101

Make sure it’s executeable:
sudo chmod +x /usr/sbin/policy-rc.d

Install

Pretty straight forward:
sudo apt-get install mysql-server-5.6

Modify Runtime Config

Change /etc/mysql/my.cnf to the following values or add them if they do not exist:

# /etc/my.cnf:
innodb_buffer_pool_size=5M
innodb_log_buffer_size=256K
query_cache_size=0
max_connections=10
key_buffer_size=8
thread_cache_size=0
host_cache_size=0
innodb_ft_cache_size=1600000
innodb_ft_total_cache_size=32000000

# per thread or per operation settings
thread_stack=131072
sort_buffer_size=32K
read_buffer_size=8200
read_rnd_buffer_size=8200
max_heap_table_size=16K
tmp_table_size=1K
bulk_insert_buffer_size=0
join_buffer_size=128
net_buffer_length=1K
innodb_sort_buffer_size=64K

#settings that relate to the binary log (if enabled)
binlog_cache_size=4K
binlog_stmt_cache_size=4K

Summary

Although the above allows MySQL 5.6 to be installed on a lower resource server, the above only allows an insall run to be made but I still encountered Out Of Memory (OOM) exceptions over time and also it was unstable (about 1-2 minutes of timeouts). The above just proves it can be installed but it won’t run as well as 5.5.

Configuring MySQL to use minimal memory
apt-get install ssh without starting?

About Danny

I.T software professional always studying and applying the knowledge gained and one way of doing this is to blog. Danny also has participates in a part time project called Energy@Home [http://code.google.com/p/energyathome/] for monitoring energy usage on a premise. Dedicated to I.T since studying pure Information Technology since the age of 16, Danny Tsang working in the field that he has aimed for since leaving school. View all posts by Danny → This entry was posted in Linux and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *.

All comments must go through an approval and anti-spam process before appearing on the website. Please be patience and do not re-submit your comment if it does not appear.

This site uses Akismet to reduce spam. Learn how your comment data is processed.