I need for my contrib smeserver-backuppc to dump all the mysql database with the user running the software, which is backuppc. I saw that signal-event pre-backup does this but when invoking with another user that root, even with sudo, the connexion to the mysql server fails with this in the log:
mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) when trying to connect
After some research, I foud that this command works
sudo /usr/bin/mysqldump -A -Q -u admin -padmin_password | sudo tee /home/e-smith/db/mysql/mysql.dump
the problem is that I'd like to do this without having to enter the admin password in clear.
Anyone got an idea ?