Note: Purpose of this question is to be a reference for anyone who has problem for upgrading their MySQL5.5 on LEMP 14.04 with 512MB / 1CPU size.
My droplet is created using LEMP 14.04 (One-click Apps) with 512MB/1CPU size. And this is by default will install Ubuntu 14.04 with Mysql 5.5.
mysql -V
mysql Ver 14.14 Distrib 5.5.49, for debian-linux-gnu (x86_64) using readline 6.3
When I’am trying to upgrade the MySQL version to 5.6*, following error occur:
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.6 (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up libhtml-template-perl (2.95-1) ...
Setting up mysql-common-5.6 (5.6.16-1~exp1) ...
Processing triggers for libc-bin (2.19-0ubuntu6) ...
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
mysql-server-5.6
E: Sub-process /usr/bin/dpkg returned an error code (1)
After hours of searching I found that the failure seems to be because of the default MySQL 5.6 configuration where it requires more memory than it can get in the micro instance. See bug report. See solution
So I’ve taken this steps to fix the errors.
sudo service mysql stop #or mysqld
sudo killall -9 mysql
sudo killall -9 mysqld
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo deluser mysql
sudo rm -rf /var/lib/mysql
sudo apt-get purge mysql-server-core-5.5
sudo apt-get purge mysql-client-core-5.5
sudo rm -rf /var/log/mysql
sudo rm -rf /etc/mysql
sudo fallocate -l 4G /swapfile
Change its permission to only root could access and change:
sudo chmod 600 /swapfile
Make it swap:
sudo mkswap /swapfile
Activate:
sudo swapon /swapfile
sudo apt-get install mysql-client-5.6 mysql-client-core-5.6
sudo apt-get install mysql-server-5.6
mysql -V
mysql Ver 14.14 Distrib 5.6.31, for debian-linux-gnu (x86_64) using EditLine wrapper
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Thanks for sharing this!