so I was trying to upgrade mysql along with other stuff on a debian wheezy box and the upgrade process was interrupted just when mysql was supposed to be restarted:
[FAIL] Stopping MySQL database server: mysqld failed!
basically the issue here is the debian-sys-maint user that should have the permission to start and stop the database server for mainteniance, such as package upgrades.
you can resolve the issue by logging in to your mysql server as root and granting the right permissions to the user again, but first copy the password from the output of the following command:
then log in to the database server and execute the needed queries:
mysql -u root -p
GRANT SHUTDOWN ON *.* TO 'debian-sys-maint'@'localhost' identified by 'paste_your_passwd_here';
GRANT SELECT ON mysql.* TO 'debian-sys-maint'@'localhost';
*DO NOT* GRANT ALL privileges to the debian-sys-maint user, just use the queries above, since that’s all the user needs, you don’t want to have another user with all privileges to all the databases on your server for obvious reasons.
Now try to restart the mysql server:
and finish the upgrade by running
apt-get dist-upgrade again.