mysql on my “lovely” debian was massed up. How did I know that? When I tried to restart mysql I am getting message that user debian-sys-maint doesn’t have privileges to run restart. Hm… What the hell is happening here? As many of debain lovers know there is the file /etc/mysql/debian.cnf and on the top of that file you have a line

# Automatically generated for Debian scripts. DO NOT TOUCH!

Between all lines there is a line with password. In my case it is

user = debian-sys-maint
password = 7dv9xdMeZygax9I2

Here are the steps to recover debian-sys-maint privileges. Log in as root in mysql shell

[root@debian ~]# mysql -u root -ppillow
mysql> UPDATE mysql.user SET Password=PASSWORD('7dv9xdMeZygax9I2') WHERE User='debian-sys-maint';
mysql> GRANT SHUTDOWN ON *.* TO 'debian-sys-maint'@'localhost' identified by '7dv9xdMeZygax9I2';
mysql> GRANT all ON mysql.* TO 'debian-sys-maint'@'localhost';
mysql> FLUSH PRIVILEGES;

Exit from mysql shell and now you can check status and restart mysql as you usually do.