how to reinstall mysql?












36















A software upgrade broke, among other things, mysql and I have not been able to get it back up yet.



Suspected cause: I had a near-full boot disk; the upgrade filled up the disk before completing and thus left everything in a mess. I have given the system more disk and moved /var to its own partition. I am still unsuccessfully trying to revive mysql.



Below is what I attempted so far (all as root).
First, mysql does not start (443). Attempts to fix (444, 445) fail. Attempts to remove mysql and (?) apparmor fail (446, 7, 8). A more energetic attempt to remove mysql seems to succeed (449) and the previous errors are no longer seen (450, 1, 2). Mysql can't be reconfigured because it's no longer there (453) but attempting to reinstall it gives back the old error messages and we're back to square one (454).



I also checked this question (even though in my case it did not break because of an upgrade to 12.04: it was already working on 12.10)
Fixing broken myslq-server package after upgrade to 12.04
and tried the suggestions in there (458, 461, 462) to no avail.



What else should I do?



This is on 3.5.0-25-generic #39-Ubuntu SMP Mon Feb 25 18:26:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux



    443  service mysql start
start: Job failed to start

444 dpkg-reconfigure mysql-server-5.5
/usr/sbin/dpkg-reconfigure: mysql-server-5.5
is broken or not fully installed

445 apt-get -f install
...
Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing 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 mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message
indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

446 apt-get remove mysql-server
...
Removing mysql-server ...
Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script
returned error exit status 1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)


447 apt-get remove apparmor
...
Package 'apparmor' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script
returned error exit status 1
Errors were encountered while processing:
mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)


448 apt-get remove mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'mysql-server' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script
returned error exit status 1
Errors were encountered while processing:
mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)

449 dpkg -r mysql-server-5.5
(Reading database ... 322156 files and directories
currently installed.)
Removing mysql-server-5.5 ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...

450 apt-get remove mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'mysql-server' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

451 apt-get remove apparmor
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'apparmor' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

452 apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

453 dpkg-reconfigure mysql-server-5.5
/usr/sbin/dpkg-reconfigure: mysql-server-5.5 is broken
or not fully installed

454 apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
mysql-server-5.5
Suggested packages:
tinyca mailx
The following NEW packages will be installed:
mysql-server mysql-server-5.5
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/8,851 kB of archives.
After this operation, 32.8 MB of additional disk space
will be used.
Do you want to continue [Y/n]?
Preconfiguring packages ...
Selecting previously unselected package mysql-server-5.5.
(Reading database ... 322081 files and directories
currently installed.)
Unpacking mysql-server-5.5 (from
.../mysql-server-5.5_5.5.29-0ubuntu0.12.10.1_amd64.deb) ...
Selecting previously unselected package mysql-server.
Unpacking mysql-server (from
.../mysql-server_5.5.29-0ubuntu0.12.10.1_all.deb) ...
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing 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 mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message
indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


458 apt-get remove --purge mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
mysql-server*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 116 kB disk space will be freed.
Do you want to continue [Y/n]?
(Reading database ... 322159 files and directories
currently installed.)
Removing mysql-server ...
Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script
returned error exit status 1
Errors were encountered while processing:
mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)

461 touch /etc/apparmor.d/local/usr.sbin.mysqld
(no output)

462 service mysql start
start: Job failed to start









share|improve this question





























    36















    A software upgrade broke, among other things, mysql and I have not been able to get it back up yet.



    Suspected cause: I had a near-full boot disk; the upgrade filled up the disk before completing and thus left everything in a mess. I have given the system more disk and moved /var to its own partition. I am still unsuccessfully trying to revive mysql.



    Below is what I attempted so far (all as root).
    First, mysql does not start (443). Attempts to fix (444, 445) fail. Attempts to remove mysql and (?) apparmor fail (446, 7, 8). A more energetic attempt to remove mysql seems to succeed (449) and the previous errors are no longer seen (450, 1, 2). Mysql can't be reconfigured because it's no longer there (453) but attempting to reinstall it gives back the old error messages and we're back to square one (454).



    I also checked this question (even though in my case it did not break because of an upgrade to 12.04: it was already working on 12.10)
    Fixing broken myslq-server package after upgrade to 12.04
    and tried the suggestions in there (458, 461, 462) to no avail.



    What else should I do?



    This is on 3.5.0-25-generic #39-Ubuntu SMP Mon Feb 25 18:26:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux



        443  service mysql start
    start: Job failed to start

    444 dpkg-reconfigure mysql-server-5.5
    /usr/sbin/dpkg-reconfigure: mysql-server-5.5
    is broken or not fully installed

    445 apt-get -f install
    ...
    Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
    start: Job failed to start
    invoke-rc.d: initscript mysql, action "start" failed.
    dpkg: error processing 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 mysql-server (--configure):
    dependency problems - leaving unconfigured
    No apport report written because the error message
    indicates its a followup error from a previous failure.
    Errors were encountered while processing:
    mysql-server-5.5
    mysql-server
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    446 apt-get remove mysql-server
    ...
    Removing mysql-server ...
    Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
    start: Job failed to start
    invoke-rc.d: initscript mysql, action "start" failed.
    dpkg: error processing mysql-server-5.5 (--configure):
    subprocess installed post-installation script
    returned error exit status 1
    No apport report written because MaxReports is reached already
    Errors were encountered while processing:
    mysql-server-5.5
    E: Sub-process /usr/bin/dpkg returned an error code (1)


    447 apt-get remove apparmor
    ...
    Package 'apparmor' is not installed, so not removed
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    1 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
    start: Job failed to start
    invoke-rc.d: initscript mysql, action "start" failed.
    dpkg: error processing mysql-server-5.5 (--configure):
    subprocess installed post-installation script
    returned error exit status 1
    Errors were encountered while processing:
    mysql-server-5.5
    E: Sub-process /usr/bin/dpkg returned an error code (1)


    448 apt-get remove mysql-server
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package 'mysql-server' is not installed, so not removed
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    1 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
    start: Job failed to start
    invoke-rc.d: initscript mysql, action "start" failed.
    dpkg: error processing mysql-server-5.5 (--configure):
    subprocess installed post-installation script
    returned error exit status 1
    Errors were encountered while processing:
    mysql-server-5.5
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    449 dpkg -r mysql-server-5.5
    (Reading database ... 322156 files and directories
    currently installed.)
    Removing mysql-server-5.5 ...
    Processing triggers for man-db ...
    Processing triggers for ureadahead ...

    450 apt-get remove mysql-server
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package 'mysql-server' is not installed, so not removed
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

    451 apt-get remove apparmor
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package 'apparmor' is not installed, so not removed
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

    452 apt-get -f install
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

    453 dpkg-reconfigure mysql-server-5.5
    /usr/sbin/dpkg-reconfigure: mysql-server-5.5 is broken
    or not fully installed

    454 apt-get install mysql-server
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following extra packages will be installed:
    mysql-server-5.5
    Suggested packages:
    tinyca mailx
    The following NEW packages will be installed:
    mysql-server mysql-server-5.5
    0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0 B/8,851 kB of archives.
    After this operation, 32.8 MB of additional disk space
    will be used.
    Do you want to continue [Y/n]?
    Preconfiguring packages ...
    Selecting previously unselected package mysql-server-5.5.
    (Reading database ... 322081 files and directories
    currently installed.)
    Unpacking mysql-server-5.5 (from
    .../mysql-server-5.5_5.5.29-0ubuntu0.12.10.1_amd64.deb) ...
    Selecting previously unselected package mysql-server.
    Unpacking mysql-server (from
    .../mysql-server_5.5.29-0ubuntu0.12.10.1_all.deb) ...
    Processing triggers for ureadahead ...
    Processing triggers for man-db ...
    Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
    start: Job failed to start
    invoke-rc.d: initscript mysql, action "start" failed.
    dpkg: error processing 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 mysql-server (--configure):
    dependency problems - leaving unconfigured
    No apport report written because the error message
    indicates its a followup error from a previous failure.
    Errors were encountered while processing:
    mysql-server-5.5
    mysql-server
    E: Sub-process /usr/bin/dpkg returned an error code (1)


    458 apt-get remove --purge mysql-server
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following packages will be REMOVED:
    mysql-server*
    0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
    2 not fully installed or removed.
    After this operation, 116 kB disk space will be freed.
    Do you want to continue [Y/n]?
    (Reading database ... 322159 files and directories
    currently installed.)
    Removing mysql-server ...
    Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
    start: Job failed to start
    invoke-rc.d: initscript mysql, action "start" failed.
    dpkg: error processing mysql-server-5.5 (--configure):
    subprocess installed post-installation script
    returned error exit status 1
    Errors were encountered while processing:
    mysql-server-5.5
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    461 touch /etc/apparmor.d/local/usr.sbin.mysqld
    (no output)

    462 service mysql start
    start: Job failed to start









    share|improve this question



























      36












      36








      36


      13






      A software upgrade broke, among other things, mysql and I have not been able to get it back up yet.



      Suspected cause: I had a near-full boot disk; the upgrade filled up the disk before completing and thus left everything in a mess. I have given the system more disk and moved /var to its own partition. I am still unsuccessfully trying to revive mysql.



      Below is what I attempted so far (all as root).
      First, mysql does not start (443). Attempts to fix (444, 445) fail. Attempts to remove mysql and (?) apparmor fail (446, 7, 8). A more energetic attempt to remove mysql seems to succeed (449) and the previous errors are no longer seen (450, 1, 2). Mysql can't be reconfigured because it's no longer there (453) but attempting to reinstall it gives back the old error messages and we're back to square one (454).



      I also checked this question (even though in my case it did not break because of an upgrade to 12.04: it was already working on 12.10)
      Fixing broken myslq-server package after upgrade to 12.04
      and tried the suggestions in there (458, 461, 462) to no avail.



      What else should I do?



      This is on 3.5.0-25-generic #39-Ubuntu SMP Mon Feb 25 18:26:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux



          443  service mysql start
      start: Job failed to start

      444 dpkg-reconfigure mysql-server-5.5
      /usr/sbin/dpkg-reconfigure: mysql-server-5.5
      is broken or not fully installed

      445 apt-get -f install
      ...
      Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
      start: Job failed to start
      invoke-rc.d: initscript mysql, action "start" failed.
      dpkg: error processing 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 mysql-server (--configure):
      dependency problems - leaving unconfigured
      No apport report written because the error message
      indicates its a followup error from a previous failure.
      Errors were encountered while processing:
      mysql-server-5.5
      mysql-server
      E: Sub-process /usr/bin/dpkg returned an error code (1)

      446 apt-get remove mysql-server
      ...
      Removing mysql-server ...
      Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
      start: Job failed to start
      invoke-rc.d: initscript mysql, action "start" failed.
      dpkg: error processing mysql-server-5.5 (--configure):
      subprocess installed post-installation script
      returned error exit status 1
      No apport report written because MaxReports is reached already
      Errors were encountered while processing:
      mysql-server-5.5
      E: Sub-process /usr/bin/dpkg returned an error code (1)


      447 apt-get remove apparmor
      ...
      Package 'apparmor' is not installed, so not removed
      0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
      1 not fully installed or removed.
      After this operation, 0 B of additional disk space will be used.
      Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
      start: Job failed to start
      invoke-rc.d: initscript mysql, action "start" failed.
      dpkg: error processing mysql-server-5.5 (--configure):
      subprocess installed post-installation script
      returned error exit status 1
      Errors were encountered while processing:
      mysql-server-5.5
      E: Sub-process /usr/bin/dpkg returned an error code (1)


      448 apt-get remove mysql-server
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      Package 'mysql-server' is not installed, so not removed
      0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
      1 not fully installed or removed.
      After this operation, 0 B of additional disk space will be used.
      Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
      start: Job failed to start
      invoke-rc.d: initscript mysql, action "start" failed.
      dpkg: error processing mysql-server-5.5 (--configure):
      subprocess installed post-installation script
      returned error exit status 1
      Errors were encountered while processing:
      mysql-server-5.5
      E: Sub-process /usr/bin/dpkg returned an error code (1)

      449 dpkg -r mysql-server-5.5
      (Reading database ... 322156 files and directories
      currently installed.)
      Removing mysql-server-5.5 ...
      Processing triggers for man-db ...
      Processing triggers for ureadahead ...

      450 apt-get remove mysql-server
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      Package 'mysql-server' is not installed, so not removed
      0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

      451 apt-get remove apparmor
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      Package 'apparmor' is not installed, so not removed
      0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

      452 apt-get -f install
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

      453 dpkg-reconfigure mysql-server-5.5
      /usr/sbin/dpkg-reconfigure: mysql-server-5.5 is broken
      or not fully installed

      454 apt-get install mysql-server
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      The following extra packages will be installed:
      mysql-server-5.5
      Suggested packages:
      tinyca mailx
      The following NEW packages will be installed:
      mysql-server mysql-server-5.5
      0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
      Need to get 0 B/8,851 kB of archives.
      After this operation, 32.8 MB of additional disk space
      will be used.
      Do you want to continue [Y/n]?
      Preconfiguring packages ...
      Selecting previously unselected package mysql-server-5.5.
      (Reading database ... 322081 files and directories
      currently installed.)
      Unpacking mysql-server-5.5 (from
      .../mysql-server-5.5_5.5.29-0ubuntu0.12.10.1_amd64.deb) ...
      Selecting previously unselected package mysql-server.
      Unpacking mysql-server (from
      .../mysql-server_5.5.29-0ubuntu0.12.10.1_all.deb) ...
      Processing triggers for ureadahead ...
      Processing triggers for man-db ...
      Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
      start: Job failed to start
      invoke-rc.d: initscript mysql, action "start" failed.
      dpkg: error processing 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 mysql-server (--configure):
      dependency problems - leaving unconfigured
      No apport report written because the error message
      indicates its a followup error from a previous failure.
      Errors were encountered while processing:
      mysql-server-5.5
      mysql-server
      E: Sub-process /usr/bin/dpkg returned an error code (1)


      458 apt-get remove --purge mysql-server
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      The following packages will be REMOVED:
      mysql-server*
      0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
      2 not fully installed or removed.
      After this operation, 116 kB disk space will be freed.
      Do you want to continue [Y/n]?
      (Reading database ... 322159 files and directories
      currently installed.)
      Removing mysql-server ...
      Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
      start: Job failed to start
      invoke-rc.d: initscript mysql, action "start" failed.
      dpkg: error processing mysql-server-5.5 (--configure):
      subprocess installed post-installation script
      returned error exit status 1
      Errors were encountered while processing:
      mysql-server-5.5
      E: Sub-process /usr/bin/dpkg returned an error code (1)

      461 touch /etc/apparmor.d/local/usr.sbin.mysqld
      (no output)

      462 service mysql start
      start: Job failed to start









      share|improve this question
















      A software upgrade broke, among other things, mysql and I have not been able to get it back up yet.



      Suspected cause: I had a near-full boot disk; the upgrade filled up the disk before completing and thus left everything in a mess. I have given the system more disk and moved /var to its own partition. I am still unsuccessfully trying to revive mysql.



      Below is what I attempted so far (all as root).
      First, mysql does not start (443). Attempts to fix (444, 445) fail. Attempts to remove mysql and (?) apparmor fail (446, 7, 8). A more energetic attempt to remove mysql seems to succeed (449) and the previous errors are no longer seen (450, 1, 2). Mysql can't be reconfigured because it's no longer there (453) but attempting to reinstall it gives back the old error messages and we're back to square one (454).



      I also checked this question (even though in my case it did not break because of an upgrade to 12.04: it was already working on 12.10)
      Fixing broken myslq-server package after upgrade to 12.04
      and tried the suggestions in there (458, 461, 462) to no avail.



      What else should I do?



      This is on 3.5.0-25-generic #39-Ubuntu SMP Mon Feb 25 18:26:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux



          443  service mysql start
      start: Job failed to start

      444 dpkg-reconfigure mysql-server-5.5
      /usr/sbin/dpkg-reconfigure: mysql-server-5.5
      is broken or not fully installed

      445 apt-get -f install
      ...
      Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
      start: Job failed to start
      invoke-rc.d: initscript mysql, action "start" failed.
      dpkg: error processing 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 mysql-server (--configure):
      dependency problems - leaving unconfigured
      No apport report written because the error message
      indicates its a followup error from a previous failure.
      Errors were encountered while processing:
      mysql-server-5.5
      mysql-server
      E: Sub-process /usr/bin/dpkg returned an error code (1)

      446 apt-get remove mysql-server
      ...
      Removing mysql-server ...
      Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
      start: Job failed to start
      invoke-rc.d: initscript mysql, action "start" failed.
      dpkg: error processing mysql-server-5.5 (--configure):
      subprocess installed post-installation script
      returned error exit status 1
      No apport report written because MaxReports is reached already
      Errors were encountered while processing:
      mysql-server-5.5
      E: Sub-process /usr/bin/dpkg returned an error code (1)


      447 apt-get remove apparmor
      ...
      Package 'apparmor' is not installed, so not removed
      0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
      1 not fully installed or removed.
      After this operation, 0 B of additional disk space will be used.
      Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
      start: Job failed to start
      invoke-rc.d: initscript mysql, action "start" failed.
      dpkg: error processing mysql-server-5.5 (--configure):
      subprocess installed post-installation script
      returned error exit status 1
      Errors were encountered while processing:
      mysql-server-5.5
      E: Sub-process /usr/bin/dpkg returned an error code (1)


      448 apt-get remove mysql-server
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      Package 'mysql-server' is not installed, so not removed
      0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
      1 not fully installed or removed.
      After this operation, 0 B of additional disk space will be used.
      Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
      start: Job failed to start
      invoke-rc.d: initscript mysql, action "start" failed.
      dpkg: error processing mysql-server-5.5 (--configure):
      subprocess installed post-installation script
      returned error exit status 1
      Errors were encountered while processing:
      mysql-server-5.5
      E: Sub-process /usr/bin/dpkg returned an error code (1)

      449 dpkg -r mysql-server-5.5
      (Reading database ... 322156 files and directories
      currently installed.)
      Removing mysql-server-5.5 ...
      Processing triggers for man-db ...
      Processing triggers for ureadahead ...

      450 apt-get remove mysql-server
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      Package 'mysql-server' is not installed, so not removed
      0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

      451 apt-get remove apparmor
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      Package 'apparmor' is not installed, so not removed
      0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

      452 apt-get -f install
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

      453 dpkg-reconfigure mysql-server-5.5
      /usr/sbin/dpkg-reconfigure: mysql-server-5.5 is broken
      or not fully installed

      454 apt-get install mysql-server
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      The following extra packages will be installed:
      mysql-server-5.5
      Suggested packages:
      tinyca mailx
      The following NEW packages will be installed:
      mysql-server mysql-server-5.5
      0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
      Need to get 0 B/8,851 kB of archives.
      After this operation, 32.8 MB of additional disk space
      will be used.
      Do you want to continue [Y/n]?
      Preconfiguring packages ...
      Selecting previously unselected package mysql-server-5.5.
      (Reading database ... 322081 files and directories
      currently installed.)
      Unpacking mysql-server-5.5 (from
      .../mysql-server-5.5_5.5.29-0ubuntu0.12.10.1_amd64.deb) ...
      Selecting previously unselected package mysql-server.
      Unpacking mysql-server (from
      .../mysql-server_5.5.29-0ubuntu0.12.10.1_all.deb) ...
      Processing triggers for ureadahead ...
      Processing triggers for man-db ...
      Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
      start: Job failed to start
      invoke-rc.d: initscript mysql, action "start" failed.
      dpkg: error processing 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 mysql-server (--configure):
      dependency problems - leaving unconfigured
      No apport report written because the error message
      indicates its a followup error from a previous failure.
      Errors were encountered while processing:
      mysql-server-5.5
      mysql-server
      E: Sub-process /usr/bin/dpkg returned an error code (1)


      458 apt-get remove --purge mysql-server
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      The following packages will be REMOVED:
      mysql-server*
      0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
      2 not fully installed or removed.
      After this operation, 116 kB disk space will be freed.
      Do you want to continue [Y/n]?
      (Reading database ... 322159 files and directories
      currently installed.)
      Removing mysql-server ...
      Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...
      start: Job failed to start
      invoke-rc.d: initscript mysql, action "start" failed.
      dpkg: error processing mysql-server-5.5 (--configure):
      subprocess installed post-installation script
      returned error exit status 1
      Errors were encountered while processing:
      mysql-server-5.5
      E: Sub-process /usr/bin/dpkg returned an error code (1)

      461 touch /etc/apparmor.d/local/usr.sbin.mysqld
      (no output)

      462 service mysql start
      start: Job failed to start






      12.10 software-installation mysql






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 13 '17 at 12:24









      Community

      1




      1










      asked Mar 8 '13 at 22:47









      st01st01

      3731411




      3731411






















          7 Answers
          7






          active

          oldest

          votes


















          75














          First, remove MySQL:



          sudo apt purge mysql-server mysql-client mysql-common
          sudo apt autoremove
          sudo mv -iv /var/lib/mysql /var/tmp/mysql-backup
          sudo rm -rf /var/lib/mysql*


          Then reinstall:



          sudo apt update
          sudo apt install mysql-server
          sudo mysql_install_db
          sudo /usr/bin/mysql_secure_installation





          share|improve this answer





















          • 1





            perfect explanation !

            – Postadelmaga
            Mar 11 '14 at 7:27











          • I think it's worth mentioning that --purge isn't necessarily what one wants, as it will remove configuration files as well. In the case of mysql specifically, I wonder if it would remove the dbs as well?

            – user50849
            Nov 20 '14 at 9:28






          • 9





            To remove the configuration and database, you will have to remove /etc/mysql and /var/lib/mysql.

            – Anne van Rossum
            Apr 18 '15 at 14:24






          • 2





            You should stop mysql service to remove mysql-server

            – Viktor
            Sep 19 '16 at 7:41






          • 4





            2017-05-20 15:12:01 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize

            – Flaudre
            May 20 '17 at 7:12



















          12














          In Ubuntu 16.04 the way to fix it in my case was (please backup DBs first, databases will be lost):



          sudo apt remove --purge mysql-server mysql-client mysql-common
          sudo apt autoremove
          sudo mv -iv /var/lib/mysql /var/tmp/mysql-backup
          sudo rm -rf /var/lib/mysql*
          sudo apt install mysql-server


          (Somehow, my previous calls to apt purge mysql-server didn't seem to succeed. I thought that apt purge foo was equivalent to apt remove --purge foo...)






          share|improve this answer


























          • This is deleting all databases. A backup is required if any data is important.

            – flickerfly
            Jul 25 '16 at 18:14



















          8














          I was getting the exact same errors and tried most of the steps you did, with the same results. The following finally worked for me.



          apt-get purge mysql-server mysql-client mysql-common mysql-client-5.5 mysql-server-5.5


          After that, mysql installed normally.






          share|improve this answer































            1














            I am not sure what was the case for me, but the other solutions did not work, it kept giving an error. I tried this apt-get purge mysql-*, then autoremove and autoclean. After that installation was fine.



            **



            Be sure to backups your databases, the above command might delete them as well



            **






            share|improve this answer































              0














              If you just run



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


              it will update mysql and this fixed the problem that i had after updating to 16.04 lts.



              Or just run



              sudo apt-get install lamp-server^


              to update all of the server packages.






              share|improve this answer

































                0














                For version MySQL 5.7 I removed MySQL as described before:



                sudo apt purge mysql-server mysql-client mysql-common
                sudo apt autoremove
                sudo rm -rf /var/lib/mysql*


                And installed it with help:



                sudo apt-get update
                sudo apt-get install mysql-server
                mysql_secure_installation


                To test if everything works:



                systemctl status mysql.service


                source






                share|improve this answer































                  -5














                  Install phpMyAdmin from the default Ubuntu repositories. Then run:



                  dpkg --configure mysql-server-5.5
                  apt-get purge mysql-server mysql-client mysql-common mysql-client-5.5 mysql-server-5.5
                  apt-get autoremove
                  apt-get autoclean
                  apt-get update
                  apt-get install mysql-server
                  service mysql restart





                  share|improve this answer





















                  • 5





                    Why install phpMyAdmin? That is completely unnecessary.

                    – Lucio
                    May 4 '14 at 17:12












                  Your Answer








                  StackExchange.ready(function() {
                  var channelOptions = {
                  tags: "".split(" "),
                  id: "89"
                  };
                  initTagRenderer("".split(" "), "".split(" "), channelOptions);

                  StackExchange.using("externalEditor", function() {
                  // Have to fire editor after snippets, if snippets enabled
                  if (StackExchange.settings.snippets.snippetsEnabled) {
                  StackExchange.using("snippets", function() {
                  createEditor();
                  });
                  }
                  else {
                  createEditor();
                  }
                  });

                  function createEditor() {
                  StackExchange.prepareEditor({
                  heartbeatType: 'answer',
                  autoActivateHeartbeat: false,
                  convertImagesToLinks: true,
                  noModals: true,
                  showLowRepImageUploadWarning: true,
                  reputationToPostImages: 10,
                  bindNavPrevention: true,
                  postfix: "",
                  imageUploader: {
                  brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                  contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                  allowUrls: true
                  },
                  onDemand: true,
                  discardSelector: ".discard-answer"
                  ,immediatelyShowMarkdownHelp:true
                  });


                  }
                  });














                  draft saved

                  draft discarded


















                  StackExchange.ready(
                  function () {
                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f265685%2fhow-to-reinstall-mysql%23new-answer', 'question_page');
                  }
                  );

                  Post as a guest















                  Required, but never shown

























                  7 Answers
                  7






                  active

                  oldest

                  votes








                  7 Answers
                  7






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes









                  75














                  First, remove MySQL:



                  sudo apt purge mysql-server mysql-client mysql-common
                  sudo apt autoremove
                  sudo mv -iv /var/lib/mysql /var/tmp/mysql-backup
                  sudo rm -rf /var/lib/mysql*


                  Then reinstall:



                  sudo apt update
                  sudo apt install mysql-server
                  sudo mysql_install_db
                  sudo /usr/bin/mysql_secure_installation





                  share|improve this answer





















                  • 1





                    perfect explanation !

                    – Postadelmaga
                    Mar 11 '14 at 7:27











                  • I think it's worth mentioning that --purge isn't necessarily what one wants, as it will remove configuration files as well. In the case of mysql specifically, I wonder if it would remove the dbs as well?

                    – user50849
                    Nov 20 '14 at 9:28






                  • 9





                    To remove the configuration and database, you will have to remove /etc/mysql and /var/lib/mysql.

                    – Anne van Rossum
                    Apr 18 '15 at 14:24






                  • 2





                    You should stop mysql service to remove mysql-server

                    – Viktor
                    Sep 19 '16 at 7:41






                  • 4





                    2017-05-20 15:12:01 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize

                    – Flaudre
                    May 20 '17 at 7:12
















                  75














                  First, remove MySQL:



                  sudo apt purge mysql-server mysql-client mysql-common
                  sudo apt autoremove
                  sudo mv -iv /var/lib/mysql /var/tmp/mysql-backup
                  sudo rm -rf /var/lib/mysql*


                  Then reinstall:



                  sudo apt update
                  sudo apt install mysql-server
                  sudo mysql_install_db
                  sudo /usr/bin/mysql_secure_installation





                  share|improve this answer





















                  • 1





                    perfect explanation !

                    – Postadelmaga
                    Mar 11 '14 at 7:27











                  • I think it's worth mentioning that --purge isn't necessarily what one wants, as it will remove configuration files as well. In the case of mysql specifically, I wonder if it would remove the dbs as well?

                    – user50849
                    Nov 20 '14 at 9:28






                  • 9





                    To remove the configuration and database, you will have to remove /etc/mysql and /var/lib/mysql.

                    – Anne van Rossum
                    Apr 18 '15 at 14:24






                  • 2





                    You should stop mysql service to remove mysql-server

                    – Viktor
                    Sep 19 '16 at 7:41






                  • 4





                    2017-05-20 15:12:01 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize

                    – Flaudre
                    May 20 '17 at 7:12














                  75












                  75








                  75







                  First, remove MySQL:



                  sudo apt purge mysql-server mysql-client mysql-common
                  sudo apt autoremove
                  sudo mv -iv /var/lib/mysql /var/tmp/mysql-backup
                  sudo rm -rf /var/lib/mysql*


                  Then reinstall:



                  sudo apt update
                  sudo apt install mysql-server
                  sudo mysql_install_db
                  sudo /usr/bin/mysql_secure_installation





                  share|improve this answer















                  First, remove MySQL:



                  sudo apt purge mysql-server mysql-client mysql-common
                  sudo apt autoremove
                  sudo mv -iv /var/lib/mysql /var/tmp/mysql-backup
                  sudo rm -rf /var/lib/mysql*


                  Then reinstall:



                  sudo apt update
                  sudo apt install mysql-server
                  sudo mysql_install_db
                  sudo /usr/bin/mysql_secure_installation






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Mar 2 at 9:15









                  rubo77

                  15.3k3197204




                  15.3k3197204










                  answered Sep 21 '13 at 21:46









                  JorenJoren

                  3,59163151




                  3,59163151








                  • 1





                    perfect explanation !

                    – Postadelmaga
                    Mar 11 '14 at 7:27











                  • I think it's worth mentioning that --purge isn't necessarily what one wants, as it will remove configuration files as well. In the case of mysql specifically, I wonder if it would remove the dbs as well?

                    – user50849
                    Nov 20 '14 at 9:28






                  • 9





                    To remove the configuration and database, you will have to remove /etc/mysql and /var/lib/mysql.

                    – Anne van Rossum
                    Apr 18 '15 at 14:24






                  • 2





                    You should stop mysql service to remove mysql-server

                    – Viktor
                    Sep 19 '16 at 7:41






                  • 4





                    2017-05-20 15:12:01 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize

                    – Flaudre
                    May 20 '17 at 7:12














                  • 1





                    perfect explanation !

                    – Postadelmaga
                    Mar 11 '14 at 7:27











                  • I think it's worth mentioning that --purge isn't necessarily what one wants, as it will remove configuration files as well. In the case of mysql specifically, I wonder if it would remove the dbs as well?

                    – user50849
                    Nov 20 '14 at 9:28






                  • 9





                    To remove the configuration and database, you will have to remove /etc/mysql and /var/lib/mysql.

                    – Anne van Rossum
                    Apr 18 '15 at 14:24






                  • 2





                    You should stop mysql service to remove mysql-server

                    – Viktor
                    Sep 19 '16 at 7:41






                  • 4





                    2017-05-20 15:12:01 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize

                    – Flaudre
                    May 20 '17 at 7:12








                  1




                  1





                  perfect explanation !

                  – Postadelmaga
                  Mar 11 '14 at 7:27





                  perfect explanation !

                  – Postadelmaga
                  Mar 11 '14 at 7:27













                  I think it's worth mentioning that --purge isn't necessarily what one wants, as it will remove configuration files as well. In the case of mysql specifically, I wonder if it would remove the dbs as well?

                  – user50849
                  Nov 20 '14 at 9:28





                  I think it's worth mentioning that --purge isn't necessarily what one wants, as it will remove configuration files as well. In the case of mysql specifically, I wonder if it would remove the dbs as well?

                  – user50849
                  Nov 20 '14 at 9:28




                  9




                  9





                  To remove the configuration and database, you will have to remove /etc/mysql and /var/lib/mysql.

                  – Anne van Rossum
                  Apr 18 '15 at 14:24





                  To remove the configuration and database, you will have to remove /etc/mysql and /var/lib/mysql.

                  – Anne van Rossum
                  Apr 18 '15 at 14:24




                  2




                  2





                  You should stop mysql service to remove mysql-server

                  – Viktor
                  Sep 19 '16 at 7:41





                  You should stop mysql service to remove mysql-server

                  – Viktor
                  Sep 19 '16 at 7:41




                  4




                  4





                  2017-05-20 15:12:01 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize

                  – Flaudre
                  May 20 '17 at 7:12





                  2017-05-20 15:12:01 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize

                  – Flaudre
                  May 20 '17 at 7:12













                  12














                  In Ubuntu 16.04 the way to fix it in my case was (please backup DBs first, databases will be lost):



                  sudo apt remove --purge mysql-server mysql-client mysql-common
                  sudo apt autoremove
                  sudo mv -iv /var/lib/mysql /var/tmp/mysql-backup
                  sudo rm -rf /var/lib/mysql*
                  sudo apt install mysql-server


                  (Somehow, my previous calls to apt purge mysql-server didn't seem to succeed. I thought that apt purge foo was equivalent to apt remove --purge foo...)






                  share|improve this answer


























                  • This is deleting all databases. A backup is required if any data is important.

                    – flickerfly
                    Jul 25 '16 at 18:14
















                  12














                  In Ubuntu 16.04 the way to fix it in my case was (please backup DBs first, databases will be lost):



                  sudo apt remove --purge mysql-server mysql-client mysql-common
                  sudo apt autoremove
                  sudo mv -iv /var/lib/mysql /var/tmp/mysql-backup
                  sudo rm -rf /var/lib/mysql*
                  sudo apt install mysql-server


                  (Somehow, my previous calls to apt purge mysql-server didn't seem to succeed. I thought that apt purge foo was equivalent to apt remove --purge foo...)






                  share|improve this answer


























                  • This is deleting all databases. A backup is required if any data is important.

                    – flickerfly
                    Jul 25 '16 at 18:14














                  12












                  12








                  12







                  In Ubuntu 16.04 the way to fix it in my case was (please backup DBs first, databases will be lost):



                  sudo apt remove --purge mysql-server mysql-client mysql-common
                  sudo apt autoremove
                  sudo mv -iv /var/lib/mysql /var/tmp/mysql-backup
                  sudo rm -rf /var/lib/mysql*
                  sudo apt install mysql-server


                  (Somehow, my previous calls to apt purge mysql-server didn't seem to succeed. I thought that apt purge foo was equivalent to apt remove --purge foo...)






                  share|improve this answer















                  In Ubuntu 16.04 the way to fix it in my case was (please backup DBs first, databases will be lost):



                  sudo apt remove --purge mysql-server mysql-client mysql-common
                  sudo apt autoremove
                  sudo mv -iv /var/lib/mysql /var/tmp/mysql-backup
                  sudo rm -rf /var/lib/mysql*
                  sudo apt install mysql-server


                  (Somehow, my previous calls to apt purge mysql-server didn't seem to succeed. I thought that apt purge foo was equivalent to apt remove --purge foo...)







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Mar 2 at 9:18









                  rubo77

                  15.3k3197204




                  15.3k3197204










                  answered Jul 11 '16 at 8:04









                  knocteknocte

                  699820




                  699820













                  • This is deleting all databases. A backup is required if any data is important.

                    – flickerfly
                    Jul 25 '16 at 18:14



















                  • This is deleting all databases. A backup is required if any data is important.

                    – flickerfly
                    Jul 25 '16 at 18:14

















                  This is deleting all databases. A backup is required if any data is important.

                  – flickerfly
                  Jul 25 '16 at 18:14





                  This is deleting all databases. A backup is required if any data is important.

                  – flickerfly
                  Jul 25 '16 at 18:14











                  8














                  I was getting the exact same errors and tried most of the steps you did, with the same results. The following finally worked for me.



                  apt-get purge mysql-server mysql-client mysql-common mysql-client-5.5 mysql-server-5.5


                  After that, mysql installed normally.






                  share|improve this answer




























                    8














                    I was getting the exact same errors and tried most of the steps you did, with the same results. The following finally worked for me.



                    apt-get purge mysql-server mysql-client mysql-common mysql-client-5.5 mysql-server-5.5


                    After that, mysql installed normally.






                    share|improve this answer


























                      8












                      8








                      8







                      I was getting the exact same errors and tried most of the steps you did, with the same results. The following finally worked for me.



                      apt-get purge mysql-server mysql-client mysql-common mysql-client-5.5 mysql-server-5.5


                      After that, mysql installed normally.






                      share|improve this answer













                      I was getting the exact same errors and tried most of the steps you did, with the same results. The following finally worked for me.



                      apt-get purge mysql-server mysql-client mysql-common mysql-client-5.5 mysql-server-5.5


                      After that, mysql installed normally.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered May 9 '13 at 17:27









                      Tom DamonTom Damon

                      40737




                      40737























                          1














                          I am not sure what was the case for me, but the other solutions did not work, it kept giving an error. I tried this apt-get purge mysql-*, then autoremove and autoclean. After that installation was fine.



                          **



                          Be sure to backups your databases, the above command might delete them as well



                          **






                          share|improve this answer




























                            1














                            I am not sure what was the case for me, but the other solutions did not work, it kept giving an error. I tried this apt-get purge mysql-*, then autoremove and autoclean. After that installation was fine.



                            **



                            Be sure to backups your databases, the above command might delete them as well



                            **






                            share|improve this answer


























                              1












                              1








                              1







                              I am not sure what was the case for me, but the other solutions did not work, it kept giving an error. I tried this apt-get purge mysql-*, then autoremove and autoclean. After that installation was fine.



                              **



                              Be sure to backups your databases, the above command might delete them as well



                              **






                              share|improve this answer













                              I am not sure what was the case for me, but the other solutions did not work, it kept giving an error. I tried this apt-get purge mysql-*, then autoremove and autoclean. After that installation was fine.



                              **



                              Be sure to backups your databases, the above command might delete them as well



                              **







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Mar 27 '15 at 13:13









                              davdav

                              1214




                              1214























                                  0














                                  If you just run



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


                                  it will update mysql and this fixed the problem that i had after updating to 16.04 lts.



                                  Or just run



                                  sudo apt-get install lamp-server^


                                  to update all of the server packages.






                                  share|improve this answer






























                                    0














                                    If you just run



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


                                    it will update mysql and this fixed the problem that i had after updating to 16.04 lts.



                                    Or just run



                                    sudo apt-get install lamp-server^


                                    to update all of the server packages.






                                    share|improve this answer




























                                      0












                                      0








                                      0







                                      If you just run



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


                                      it will update mysql and this fixed the problem that i had after updating to 16.04 lts.



                                      Or just run



                                      sudo apt-get install lamp-server^


                                      to update all of the server packages.






                                      share|improve this answer















                                      If you just run



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


                                      it will update mysql and this fixed the problem that i had after updating to 16.04 lts.



                                      Or just run



                                      sudo apt-get install lamp-server^


                                      to update all of the server packages.







                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited Aug 30 '16 at 14:46









                                      edwinksl

                                      17.4k125487




                                      17.4k125487










                                      answered Aug 30 '16 at 13:54









                                      user558503user558503

                                      1




                                      1























                                          0














                                          For version MySQL 5.7 I removed MySQL as described before:



                                          sudo apt purge mysql-server mysql-client mysql-common
                                          sudo apt autoremove
                                          sudo rm -rf /var/lib/mysql*


                                          And installed it with help:



                                          sudo apt-get update
                                          sudo apt-get install mysql-server
                                          mysql_secure_installation


                                          To test if everything works:



                                          systemctl status mysql.service


                                          source






                                          share|improve this answer




























                                            0














                                            For version MySQL 5.7 I removed MySQL as described before:



                                            sudo apt purge mysql-server mysql-client mysql-common
                                            sudo apt autoremove
                                            sudo rm -rf /var/lib/mysql*


                                            And installed it with help:



                                            sudo apt-get update
                                            sudo apt-get install mysql-server
                                            mysql_secure_installation


                                            To test if everything works:



                                            systemctl status mysql.service


                                            source






                                            share|improve this answer


























                                              0












                                              0








                                              0







                                              For version MySQL 5.7 I removed MySQL as described before:



                                              sudo apt purge mysql-server mysql-client mysql-common
                                              sudo apt autoremove
                                              sudo rm -rf /var/lib/mysql*


                                              And installed it with help:



                                              sudo apt-get update
                                              sudo apt-get install mysql-server
                                              mysql_secure_installation


                                              To test if everything works:



                                              systemctl status mysql.service


                                              source






                                              share|improve this answer













                                              For version MySQL 5.7 I removed MySQL as described before:



                                              sudo apt purge mysql-server mysql-client mysql-common
                                              sudo apt autoremove
                                              sudo rm -rf /var/lib/mysql*


                                              And installed it with help:



                                              sudo apt-get update
                                              sudo apt-get install mysql-server
                                              mysql_secure_installation


                                              To test if everything works:



                                              systemctl status mysql.service


                                              source







                                              share|improve this answer












                                              share|improve this answer



                                              share|improve this answer










                                              answered Aug 20 '18 at 12:05









                                              ViktorminatorViktorminator

                                              1012




                                              1012























                                                  -5














                                                  Install phpMyAdmin from the default Ubuntu repositories. Then run:



                                                  dpkg --configure mysql-server-5.5
                                                  apt-get purge mysql-server mysql-client mysql-common mysql-client-5.5 mysql-server-5.5
                                                  apt-get autoremove
                                                  apt-get autoclean
                                                  apt-get update
                                                  apt-get install mysql-server
                                                  service mysql restart





                                                  share|improve this answer





















                                                  • 5





                                                    Why install phpMyAdmin? That is completely unnecessary.

                                                    – Lucio
                                                    May 4 '14 at 17:12
















                                                  -5














                                                  Install phpMyAdmin from the default Ubuntu repositories. Then run:



                                                  dpkg --configure mysql-server-5.5
                                                  apt-get purge mysql-server mysql-client mysql-common mysql-client-5.5 mysql-server-5.5
                                                  apt-get autoremove
                                                  apt-get autoclean
                                                  apt-get update
                                                  apt-get install mysql-server
                                                  service mysql restart





                                                  share|improve this answer





















                                                  • 5





                                                    Why install phpMyAdmin? That is completely unnecessary.

                                                    – Lucio
                                                    May 4 '14 at 17:12














                                                  -5












                                                  -5








                                                  -5







                                                  Install phpMyAdmin from the default Ubuntu repositories. Then run:



                                                  dpkg --configure mysql-server-5.5
                                                  apt-get purge mysql-server mysql-client mysql-common mysql-client-5.5 mysql-server-5.5
                                                  apt-get autoremove
                                                  apt-get autoclean
                                                  apt-get update
                                                  apt-get install mysql-server
                                                  service mysql restart





                                                  share|improve this answer















                                                  Install phpMyAdmin from the default Ubuntu repositories. Then run:



                                                  dpkg --configure mysql-server-5.5
                                                  apt-get purge mysql-server mysql-client mysql-common mysql-client-5.5 mysql-server-5.5
                                                  apt-get autoremove
                                                  apt-get autoclean
                                                  apt-get update
                                                  apt-get install mysql-server
                                                  service mysql restart






                                                  share|improve this answer














                                                  share|improve this answer



                                                  share|improve this answer








                                                  edited May 4 '14 at 17:09









                                                  Eric Carvalho

                                                  42.4k17116147




                                                  42.4k17116147










                                                  answered May 4 '14 at 16:43









                                                  user277883user277883

                                                  1




                                                  1








                                                  • 5





                                                    Why install phpMyAdmin? That is completely unnecessary.

                                                    – Lucio
                                                    May 4 '14 at 17:12














                                                  • 5





                                                    Why install phpMyAdmin? That is completely unnecessary.

                                                    – Lucio
                                                    May 4 '14 at 17:12








                                                  5




                                                  5





                                                  Why install phpMyAdmin? That is completely unnecessary.

                                                  – Lucio
                                                  May 4 '14 at 17:12





                                                  Why install phpMyAdmin? That is completely unnecessary.

                                                  – Lucio
                                                  May 4 '14 at 17:12


















                                                  draft saved

                                                  draft discarded




















































                                                  Thanks for contributing an answer to Ask Ubuntu!


                                                  • Please be sure to answer the question. Provide details and share your research!

                                                  But avoid



                                                  • Asking for help, clarification, or responding to other answers.

                                                  • Making statements based on opinion; back them up with references or personal experience.


                                                  To learn more, see our tips on writing great answers.




                                                  draft saved


                                                  draft discarded














                                                  StackExchange.ready(
                                                  function () {
                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f265685%2fhow-to-reinstall-mysql%23new-answer', 'question_page');
                                                  }
                                                  );

                                                  Post as a guest















                                                  Required, but never shown





















































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown

































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown







                                                  Popular posts from this blog

                                                  Mouse cursor on multiple screens with different PPI

                                                  Agildo Ribeiro

                                                  Sometime when accessing a menu: “Ubuntu 16.04 has experienced an internal error”