Reinstall of mysql server hangs

8,908

Solution 1

In my case, I was simply trying to install updates and it hung the same way:

Setting up mysql-server-5.6 (5.6.28-0ubuntu0.14.04.1) ...

The suggestion above didn't work and suggests at why the upgrade process had failed:

$ sudo service mysql stop
stop: Unknown instance: 

It didn't appear to have the correct PID to stop MySQL, so I stopped it through the other method:

$ sudo /etc/init.d/mysql stop
 * Stopping MySQL database server mysqld                                                 [ OK ]

and the installer continued normally and completed.

Solution 2

I thought I would add this answer just in case someone else is googling for this problem like I was. My situation wasn't exactly the same in that I was simply upgrading the entire system (sudo apt-get upgrade) but it was getting stuck on the same line:

Setting up mysql-server (5.5.46-0ubuntu0.14.04.2) ...

All I did was open another ssh session and then ran

sudo service mysql stop

And then the upgrade continued as normal. This is probably easier than completely removing mysql.

Solution 3

For me was an out of memory issue. I am running it in a Virtual Box and only when I went for increasing the machine's memory that passed the hung up part.

Try this:

dmesg | tail -20 

and search for memory problem at mysqld initialization.

Share:
8,908

Related videos on Youtube

SK176H
Author by

SK176H

Updated on September 18, 2022

Comments

  • SK176H
    SK176H over 1 year

    I am trying to reinstall mysql-server-5.5 because mysql server would not start. I purged everything but the install fails I am trying to reinstall using sudo apt-get install mysql-server-5.5 and it comes to this point and does not do anything.

    Can someone help. This is on Ubuntu 14.04

    sudo apt-get install mysql-server-5.5 --reinstall
    [sudo] password for shrikant: 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 1 not upgraded.
    Need to get 0 B/1,744 kB of archives.
    After this operation, 0 B of additional disk space will be used.
    Preconfiguring packages ...
    (Reading database ... 303520 files and directories currently installed.)
    Preparing to unpack .../mysql-server-5.5_5.5.41-0ubuntu0.14.04.1_amd64.deb ...
    mysql stop/waiting
    Unpacking mysql-server-5.5 (5.5.41-0ubuntu0.14.04.1) over (5.5.41-0ubuntu0.14.04.1) ...
    Replaced by files in installed package mysql-common (5.6.23-1ubuntu14.04) ...
    Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
    Processing triggers for ureadahead (0.100.0-16) ...
    ureadahead will be reprofiled on next reboot
    Setting up mysql-server-5.5 (5.5.41-0ubuntu0.14.04.1) ...
    

    Although I remember doing all of these steps I must have missed some here and there.

    This resolved my issue

    https://stackoverflow.com/questions/25244606/completely-remove-mysql-ubuntu-14-04-lts

    • Dustin McKenna-Watts
      Dustin McKenna-Watts about 9 years
      What do you mean you purged everything? What command did you use? Make sure you use sudo apt-get --purge remove mysql* Then reboot the majcine for extra measure, then reinstall. Lemme know how it works out.
  • Dowlers
    Dowlers over 7 years
    Thanks for this. In my case mt OS upgrade from trusty to xenial kept hanging when configuring mysql. Opening a terminal and stopping the service allowed it to continue.
  • sarlacii
    sarlacii about 4 years
    As an addition, running "sudo /etc/init.d/mysql stop" resulted in a " * Stopping MySQL database server mysqld ...done." message. But, same dpkg config screen persisted, until I ran "sudo service mysql stop" which then logged "mysql stop/waiting" to console, and the dpkg screen exited. So there may be two processes running, and you need to kill them all.