Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: Daniel B. on August 21, 2006, 05:36:10 PM

Title: dump mysql with another user that root ?
Post by: Daniel B. on August 21, 2006, 05:36:10 PM
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:
Code: [Select]
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

Code: [Select]
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 ?
Title: Re: dump mysql with another user that root ?
Post by: CharlieBrady on August 22, 2006, 02:55:23 AM
Quote from: "VIP-ire"

Anyone got an idea ?


HOME=/root sudo /sbin/e-smith/signal-event pre-backup
Title: Re: dump mysql with another user that root ?
Post by: knut on August 22, 2006, 12:29:17 PM
Quote from: "CharlieBrady"
Quote from: "VIP-ire"

Anyone got an idea ?


HOME=/root sudo /sbin/e-smith/signal-event pre-backup


I got the same problem once when I changed the mysql root password with PHPMyAdmin. After some research I found out how to reset the root password of MYSQL.

Read about the solution here: http://knut.sandvik.bz/2006/08/18/change-the-root-password-of-mysql-on-sme-server-version-7/
Title: Re: dump mysql with another user that root ?
Post by: CharlieBrady on August 22, 2006, 12:50:58 PM
Quote from: "knut"

I got the same problem once when I changed the mysql root password with PHPMyAdmin.


No, you got a different problem (you had "using password: YES"). And I hope you learnt never to change the mysql root password.
Title: I sure learnt to never change the password
Post by: knut on August 22, 2006, 12:55:22 PM
Luckily it was on my personal webserver and not on any critical systems.
Title: Re: dump mysql with another user that root ?
Post by: Daniel B. on August 23, 2006, 10:56:34 AM
Quote from: "CharlieBrady"

HOME=/root sudo /sbin/e-smith/signal-event pre-backup


Thanks a lot CharlieBrady, it's working