I have a dedicated Debian 7 server running multiple websites with MySQL as the database server. When I tried to install the latest updates, MySQL couldn't be updated because the server failed to stop.
I found someone with similar symptoms in this question: https://superuser.com/questions/268053/debian-cant-stop-mysql-permissions
The answers to the above question suggest granting full privileges on all databases to 'debian-sys-maint'@'localhost'
, but when I try to grant the privileges I get an access denied error.
mysql> GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '...';
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
mysql> GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost';
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Another weird thing is I now have two root users in my mysql.user
table. Is this normal or could this be related to my problem? The localhost.localdomain
one doesn't even have a password hash. I also have one user for each site I run but I left them out for clarity.
+-----------------------+------------------+
| Host | User |
+-----------------------+------------------+
| localhost | debian-sys-maint |
| localhost | root |
| localhost.localdomain | root |
+-----------------------+------------------+
Edit: Running dpkg-reconfigure mysql-server
says this:
xxx@yyy:~$ sudo dpkg-reconfigure mysql-server
/usr/sbin/dpkg-reconfigure: mysql-server is broken or not fully installed
Searching by that error led me to a forum post suggesting there may be older packages messing things up, but to me it looks like that's not the case here:
xxx@yyy:~$ sudo dpkg --get-selections | grep mysql
dovecot-mysql install
libdbd-mysql-perl install
libmysqlclient18:amd64 install
mysql-client-5.5 install
mysql-common install
mysql-server install
mysql-server-5.5 install
mysql-server-core-5.5 install
php5-mysql install