MYSQL Permission: Access denied for user ‘debian-sys-maint’@’localhost

debianMySQLpermissions

Got a problem with a mysql server installation on Debian. (Not my server so I have no idea what caused this…)

Installing new applications that add a database fail with error:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

I can log in with the user, I've flushed permissions…

Then I can across this question:
https://stackoverflow.com/questions/1709078/how-can-i-restore-the-mysql-root-users-full-privileges

But when I try to stop mysql, it fails with

error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'

Best Answer

Debian use debian-sys-maint account for management (start/stop etc.). Credentials are stored in /etc/mysql/debian.cnf - check if all are valid.