Bug #86
Error While Backing Up MySQL Using rsnapshot and mysqldump
Description
While setting up the backup system for a server and testing the rsnapshot script I get an error:
mysqldump: Got error: 1045: Access denied for user 'debian-sys-maint'@'localhost' (using password: YES) when trying to connect
Related issues
Updated by Daniel Curtis over 11 years ago
- Status changed from New to Closed
- Assignee set to Daniel Curtis
- % Done changed from 0 to 100
There is either no user debian-sys-maint in the MySQL user table, or the password for debian-sys-maint in the MySQL user table does not match /etc/mysql/debian.cnf
Refer to https://project.altservice.com/issues/85#Create-debian-sys-maint-user
Updated by Daniel Curtis over 10 years ago
I managed to come up with a fix. First get the password of the debian-sys-maint user from the default configuration:
cat /etc/mysql/debian.cnf
#! Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = debian-sys-maint
password = <password>
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = debian-sys-maint
password = <password>
socket = /var/run/mysqld/mysqld.sock
basedir = /usr
Then log into a mysql console as root:
mysql -u root -p
Then update the debian-sys-maint users password:
GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '<password>'; FLUSH PRIVILEGES;