I have upgraded to the latest 4.13-2 release and yet my MySQL backups are failing.
The error is
Dumping MySQL database db_prod1 …
… dump failed! mysqldump: Got error: 1045: Access denied for user ‘root’@‘localhost’ (using password: YES) when trying to connect
It was suggested I check to make sure the MySQL root password was the same, and I reset it then changed it in MySQL Module config. I ran a backup and the error still persists.
At first glance, it sounds like Virtualmin isn’t seeing or using your correct MySQL password for some reason. I suspect it’s not just an issue with backups, but we’ll have to test that to be sure.
First off, if you go into System Settings -> Re-Check Config, does that detect any problems?
If not, are you able to create a new Virtual Server that has the “MySQL Database” feature enabled?
I’ve also been noticing failures myself going back about 5 or so days. I do nightly backups and so far the only thing failing is the mysql dump. I’ve gone through a system settings ->re-check as well and everything looks good.
Wow, that resolved it. That’s weird though. The file was last edited early on in 2014 so it might have been apart of my cPanel migrations in 2014. But the file has definitely been in that director for quite a bit of time, several months.
Either way, that resolved it for me. Thanks so much for all your hard work guys.
I can confirm I had a .my.cnf file in my virtual server home directory and removing it cured the problems, I am now able to dump database. The file was probably a hangover from my cPanel days.
The issue came up now due to a change in the way Virtualmin handles backups… it’s seeking to be more secure, and moving more towards running as much as it can as the Virtual Server owner, rather than root.
In doing so, it’s inadvertently pulling the settings from the .my.cnf file located in the Virtual Server owner’s home directory.
I believe Jamie is working on preventing that behavior for a future release, removing the .my.cnf file is just a temporary thing until Jamie comes up with a better long-term solution (ie, getting Virtualmin/MySQL to ignore that file during the backup process if it exists).
I have 50 + sites that all uses the .my.cnf that I am unable to backup off. Is there anyway to roll back to 4.12 as it did not seem to have the problem or is there an ETA on the fix?. All our sites depend on the .my.cnf.
Why don’t you just delete the .my.cnf files? I’m assuming you’re an ex cPanel customer and they are a leftover of that. If so, why do you need them now?
Are those.my.cnf files even needed in Virtualmin virtual server home directories?