Unable to install MySQL on Ubuntu 14.04.2 LTS

June 29, 2015 14.2k views
Linux Commands MySQL

I'm trying to install MySQL on Ubuntu 14.04.2, (Ubuntu Ruby on Rails on 14.04 (Postgres, Nginx, Unicorn) to be specific).

I'm running this command to install -
sudo apt-get install mysql-serve as root

During the installation, I'm encountering this error -

Setting up mysql-server-core-5.5 (5.5.43-0ubuntu0.14.04.1) ...
Setting up mysql-server-5.5 (5.5.43-0ubuntu0.14.04.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any idea what's going wrong?

  • Did you first perform a

    apt-get update

    in order to update your apt database?

  • yep, I did that. Still getting the same error.

    Don't know if it helps, but
    I'm running this to remove the current installation -

    sudo apt-get remove --purge mysql-server mysql-client mysql-common
    sudo apt-get autoremove
    sudo apt-get autoclean

    And then installed MySQL using the above mentioned command. Still getting the same issue.

  • you might try removing your install of mysql first:

    sudo apt-get remove mysql-server&&sudo apt-get autoremove

    then reinstall mariadb:

    get the repository for latest mariadb
    sudo apt-get install software-properties-common
    sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
    sudo add-apt-repository 'deb http://mirror.stshosting.co.uk/mariadb/repo/10.0/ubuntu trusty main'
    install the needed things
    sudo apt-get update&&sudo apt-get upgrade
    sudo apt-get install mariadb-server mariadb-client 
  • Similar issues with mariadb as well. I'm thinking it might be due to the 512mb ram droplet I'm using. Does that make sense?

  • I have several 512mb droplets all running Mariadb happily.

    Here is something that looks like it might help:


  • Oh, that's great!
    I remember seeing mariadb installation throwing an error about lack of memory, and so I've upgraded the droplet. This fixed the issue as of now, but thanks for the link. I'll look into it.

1 Answer

Okay, so upgrading the droplet to 1gb ram fixed the issue. Most probably, the mysql service was unable to start due to lack of memory. Maria DB reported a lack of memory while installing.

Have another answer? Share your knowledge.