Wednesday, September 9, 2009

Access denied for user 'debian-sys-maint'@'localhost'

I wanted to get replication setup to do backups offline as recommended by this article. I did the backup and loaded it onto the slave. When I went to restart, I received:

ERROR 1045 (28000): Access denied for user 'debian-sys-maint'@'localhost'


It turns out I backed up the users table as well so it blew away the debian user. I found the fix here .

The trick is to reset the debian-sys-maint users password by looking in /etc/mysql/debian.cnf and performing the following with whatever password you find in there:


GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '' WITH GRANT OPTION;

2 comments:

Donal Morrissey said...

Great, cheers for that! One small thing: I would suggest is to put something like 'CopiedPasswordHere' where the password is expected. I'm a complete noob when it comes to mysql admin, so had to do a bit of further digging to find out where to put the password.
Cheers,
Donal

BarneyGoo said...

Thank you Brian. I think that's the fastest google-and-fix I have ever done.

Graham