Access denied for debian-sys-maint

Solution to the error: ‚Access denied for user ‚debian-sys-maint’@’localhost‘ (using password: YES)‘.

Inhaltsverzeichnis

After a mysql database import i got this error message from cron.

Error Message

/etc/cron.daily/logrotate:
connect to server at 'localhost' failed
Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)
error: error running shared postrotate script for '/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/error.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1

Solution

The password is not the same after the database import.

#get the password
cat /etc/mysql/debian.cnf

#set the password
mysql -uroot -p
GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'HsFHAHAHAHAJjNg';
quit
systemctl restart mysql

#check if the error disappears
/etc/cron.daily/logrotate

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Nach oben scrollen