I just tried to upgrade from debian squeeze to unstable by replacing 'squeeze' with 'unstable' in /etc/apt/sources.list. The upgrade went smoothly except for mysql, which failed because it couldn't stop mysql. /etc/init.d/mysql stop simply returns that it failed, but if I try to get the status with /etc/init.d/mysql status it gives me this error:

me@debian:~$ sudo /etc/init.d/mysql status /usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)' .

mysql is running fine, and I checked the permissions for debian-sys-maint in phpmyadmin and it's allowed to do everything, but only connect from 'localhost.'

link|improve this question
feedback

2 Answers

Try this:

  1. sudo cat /etc/mysql/debian.cnf and look for the password listed under both the [client] and [mysql_upgrade] sections

  2. mysql -u root -p password being the original MySQL root password

  3. GRANT ALL PRIVILEGES ON . TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'the password obtained from step 1';

  4. /etc/init.d/mysql restart

That's the fix and this is the reasoning behind it, if you're interested.

link|improve this answer
feedback

An update to the answer. In step 3, I had to use

GRANT ALL PRIVILEGES ON . TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'the password obtained from step 1';

There are stars around the period after "ON". Worked for mysql 5.1

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.