Post-install Wizard should be much more graceful about database root password already being set

This has come up a bunch in recent months/years, and I've even seen it myself on a couple of test installs on virtual machines.

A lot of times, there will be a root password set for MySQL, but the user doesn't know it, and so Virtualmin makes them do a clumsy bouncing around between Webmin (and maybe command line; I don't think even the Webmin module will correctly handle resetting a password if you don't know the original one).

There should be a "go nuclear" sort of option, to allow the user to tell Virtualmin to force a reset of the root password, if they don't know the existing one. This would, of course, need to go through the rigamarole of stopping MySQL, starting it with --skip-grant-tables and --skip-networking options, resetting the password, and then restarting it normally. But, it'd make a lot of customer complaints/confusions go away.

We also probably need a better error message. But, I guess if we just added a checkbox to say "force reset of root password", that'd make it less of a big deal that the error is scary for some.



That's not a bad idea, although it would need to have a big warning so that experienced admins don't blow away their root password and break other apps already talking to MySQL.

Joe's picture
Submitted by Joe on Sat, 02/18/2017 - 17:30 Pro Licensee

Yes, I think it should be clear about what's happening, but I got a report that it always happens, even on a fresh install with no one ever having set the password, on Debian. So, it seems like some distros now set a password regardless of what the user knows about. We just need to handle it better. Resetting it from the command line is intimidating for non-technical users.

Any idea what Debian sets the default password to? An even better user experience would be to have Webmin use that by default, if possible.

Joe's picture
Submitted by Joe on Mon, 02/20/2017 - 23:43 Pro Licensee

From the docs: "During the installation of MySQL Server you were prompted to set the password for the root user for the database. If you forget this password or if there are some issues during the installation you can reset the root password using the steps below."

I have no idea what it does when we use the -y option to install it non-interactively. Leaving it blank in Virtualmin obviously doesn't work. I guess it's something random. Maybe it says what it's setting it to during install. I'll try to run a test install tomorrow and see if there are any clues about what it's setting it to.

I think we just need to make it easy to set during postinstall if the user doesn't know it. That really seems to be the behavior users expect/demand. (I opened this ticket because of a review posted on a web hosting forum where the author seemed quite frustrated by this step not being easy at all.)

Ok, I'll go with your idea of forcibly resetting the password.