Ubuntu 14.04 MySQL 5.6 Upgrade Issue: Can't Start MySQL

I have a droplet that I had installed MySQL 5.5 upon initial setup of server a year or so ago but haven’t needed MySQL until recently. First, I wanted to update to 5.6 as it was what the project called for. So I ssh’d into the server and made sure everything was in working order first; logged into mysql, looked at the default test db etc, all was well. So I went on to updating:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install mysql-server-5.6

Everything appeared to be going fine, but upon exiting the install I get the following:

2017-04-12 15:00:51 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2017-04-12 15:00:51 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-04-12 15:00:51 0 [Note] /usr/sbin/mysqld (mysqld 5.6.33-0ubuntu0.14.04.1) starting as process 6673 ...
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
E: Sub-process /usr/bin/dpkg returned an error code (1)

And when trying to connect to mysql (mysql -u root -p) I get:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)

I’ve completely uninstalled, reinstalled, cleaned, autocleaned, and am at a loss. I even tried uninstalling 5.6 and trying to go back to 5.5 but that results in the same as above. What have I done? And what can I do to resolve it?


Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Accepted Answer

If it were me I’d remove any instances of old MySQL configurations - it could just be something is configured from the old setup, is the error message still the same or has it changed at all?

In mycase ::

Ubuntu14.04 -> 16.04 upgrade.

MySQL db updates from old to 5.7 .

xxxxxxx start: Job failed to start invoke-rc.d: initscript mysql, action “start” failed. dpkg: error processing package mysql-server-5.7 (–configure): ‘thread-concurrency=10’ option was unknown to new version 5.7.

So, I edit /etc/mysql/my.cnf , comment out , add ‘#’ on ‘thread-concurrency=10’ option line.

and then it Works!.

When upgrading , May be there’s uncompatible option is exists. check the error logs and manually modify my.cnf first.

Good Luck.


swap isn’t generally recommended on solid-state disks (even DigitalOcean recommends against it) as it can degrade disk performance – this is especially the case if you’re using swap as more than just a means to provide temporary relief of an issue (i.e you’re using it as a source of RAM in place of physically upgrading).

Even with SSD’s, RAM is still faster, which means offloading to swap (i.e. the disk) is going to be far slower than it would be with RAM and it’s going to cause higher CPU usage (as high disk usage causes wait times to jump, thus CPU jumps with it).

That said, the error you’re seeing is most likely due to a package of some sort being left behind and it’s causing issues.

You should be able to run:

apt-get -y remove mysql* && apt-get -y purge mysql*

Then try running:

apt-get update && apt-get -y upgrade

And it wipe the vast majority of what is installed – while updating/upgrading existing packages. Some directories and files may still persist, though that should get rid of MySQL and it’s dependencies for the most part.

NOTE – Purge may remove your database data. So if you need data and haven’t backed it up, you may lose it and there’s no way to recover it unless you’ve got backups.

What you’ve posted doesn’t show an issue with limited RAM, though it very well could be the case if MySQL fails to start once you get it installed without conflicts. 512MB of RAM really isn’t much to be honest. Yes, you can run MySQL on 512MB RAM, though not all that efficiently and you need to know how to tweak/tune MySQL for low-RAM use cases. The default configuration most likely won’t be suitable and isn’t really meant for production – it’s meant as a starting point.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel