These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for Setting a password for root user in MySQL on the new forum.
I think you should probably provide an interface/mechanism for setting the root user passwords in MySQL after the database is installed.
There are two root user entries for MySQL (localhost and mydomain.com) that don't have passwords initially.
I tried changing the root user password through Webmin, but it gave me an error:
DBI connect failed : Access denied for user 'root'@'localhost' (using password: NO)
It did appear to change the password, but just didn't recover nicely from this change. It probably should prompt you again for the log in user/password to access the database.
Anyway, this process seems to require a little more work.
BTW, my suggestion here is not just to fix the bug with manually setting the password for root, but is also a request to do the resetting earlier (maybe during installation or immediately thereafter). Or, make it clear somehow that users should change this (like an alert).
I did same thing as you. I changed MySQL root password throw mysql shell and now I'm getting error when I'm trying to add/edit/update settings throw virtualmin panel I'm getting "Access denied for user 'root'@'localhost' (using password: NO)" error.
What should I do to get rid of that error and also protect root account with password?
I'm not sure if I missed something during install, but a warning regarding the blank passwords may be prudent. Especially since everything works so well 'out of the box'.
Yup! You should receive a warning on an installation with no MySQL root password set.
That should appear when the first-time wizard is finishing up after you log into Virtualmin for the first time.
You can view it again by going into System Settings, and running "Re-Check Config".
You need to set the password for the Webmin MySQL module. It has no idea that you've changed the password or what you've changed it to--all it knows is that it can't connect anymore. Set this in the Module Configuration.
We do recommend changing the MySQL password, and include the steps for setting of it in the MySQL module, somewhere in the documentation...but I'm not seeing immediately where. I'll add it to the installation guide. It'll probably be added to the install script in the next few weeks.
You can also set the MySQL password from within Webmin, without having to hit the command line, in the User Permissions page.
Check out the forum guidelines!
I don't get it... how do I set that root user password for MySQL? The Link on the starting page has disappeared...
Editing the root User in MySQL -User configuration, trying to change password from none to "mypassword" I get the message:
"DBI connect failed : Access denied for user 'root'@'localhost' (using password: NO)"
but then in the next step I had to log in again with the new password and recheck configuration now says:
"MySQL is installed and running."
So everything is fine now... Virtualmins message is not very helpful at that point...