I’m struggling with a problem with backup and restores on one of our systems… I can’t seem to track down what’s going on here and hoping someone can help without needing to open a support case.
When I do a backup of a virtual server (only Apache and MySQL configured for the virtual server) and do a restore, it always fails to connect to the MySQL database when trying to recreate it. I "untarred" the backup and checked the .backup/<username>_webmin file and it looks like the username/password is correct, but the output when trying to restore says that access denied when connecting to username @ localhost. I can use mysql to connect to the database from the shell just fine.
I even tried to create a whole new virtual server to test with. I did a default Drupal install, backup and restore. When it restored, it did the same thing. All the files were there in the home directory, I was just missing my MySQL data (database and user do exist).
The admin password and MySQL password are the same, and when I created the new server I left it that way as well.
I can then use the “execute SQL” option in Virtualmin to restore the database after I extract it from the tarball, but that’s less than ideal.
Server is: Virtualmin 3.67 Pro and Ubuntu 8.04, fully patched.
One thing to check is if you have a /root/.my.cnf or /.my.cnf file on your system. In some cases, if this contains a password= line which is incorrect it can override the password Webmin tries to use to connect to MySQL.
If this file exists, either delete it or remove or correct the password= line.
Another thing you can try is going to Webmin -> Servers -> MySQL Database -> Module Config, and change the ‘Use MYSQL_PWD variable to pass password?’ option to ‘No’.
Yeah, I can create backups of the MySQL databases and restore them manually, but the restore doesn’t seem to work when it’s bundled up in a Virtualmin backup.
Hmm well I feel like a bit of a n00b that I didn’t mention that, but yes, I’ve been trying to do this as the domain owner.
It does appear that root (or my user that has sudo access) is able to do a restore. I hadn’t tried that before… (the idea behind utilizing Virtualmin on this server is so users can test upgrades and fail back to a user-created backup without involving one of our admins).
I’ll try to answer the next logical question: when I login as the user trying to do the restore, I am able to manage that user’s databases.
Ok, I see the bug that is causing this now, and will fix it in the next Virtualmin release. If you don’t want to wait till then, you can edit the file virtual-server/feature-mysql.pl under the Webmin root directory, and change line 491 from :