FIX: Errors with installing MySQL on Ubuntu

In order to install a LNMP environment on a VPS, I've tried the following command to install MySQL server, but what I got is:

130816 18:53:17  InnoDB: Waiting for the background threads to start
130816 18:53:18 InnoDB: 5.5.32 started; log sequence number 1595675
130816 18:53:18  InnoDB: Starting shutdown...
130816 18:53:19  InnoDB: Shutdown completed; log sequence number 1595675
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
                                                              Processing triggers for ureadahead ...
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

It's really an error message that says nothing. The ubuntu is freshly installed. After hours of trying with solutions from Internet, I've found the following solution working for me:

sudo apt-get clean

sudo apt-get autoclean

sudo apt-get remove --purge mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5

sudo apt-get install mysql-server

before reinstalling, you may need also the following commands:

rm -rf /var/lib/mysql
rm -rf /etc/mysql*

So it is.

No comments: