re-enabling a website fails to restore mysql database password.

5 posts / 0 new
Last post
#1 Thu, 11/14/2019 - 02:01

re-enabling a website fails to restore mysql database password.


I had a website that had been disabled for quite some time (a month or two) and recently re-enabled it, but got an error stating that the DB user's password failed to be reset. Unfortunately, I didn't take note of the exact error message I received. Trying to set the password (to what it should be) manually, I get this error:

Failed to change database passwords : SQL set password for 'XXX'@'' = password('PASS') failed : Can't find any matching row in the user table

Looking around for solutions (on virtualmin), I notice that there was a request for select user,host from mysql.user where user = "XXX" which returns for me: "XXX" localhost

So, it seems that my problem is that my virtmin is using 'localhost' as the host when it was set up, but the current version of virtmin (6.08.gpl) is trying to use

I've disabled and restored this site a few times in the past without any issues, so figure it's to do with a recent virtmin update (it's a staging website that I take offline when not needed)

What's the best way to restore the password, so that the site works?

Operating system Ubuntu Linux 16.04.1
Virtualmin version 6.08.gpl Pro
Webmin version 1.932
Package updates: All Virtualmin packages are up to date.

Thu, 11/14/2019 - 02:23
Thu, 11/14/2019 - 07:58

Wow. I swore I had mariaDB installed (the machine was originally a Ubuntu 14 LTS), but now I see that it's mysql:

Your MySQL connection id is 4909
Server version: 5.7.27-0ubuntu0.16.04.1 (Ubuntu)

(I did not notice this happening)

I notice in netstat that it's listening on

I also notice that skip_name_resolve is OFF

Would the best course be to change the DB entries for mysql.user to use (I notice all the users there use localhost and not just this problematic one)

Edit: PS, I used the virtualmin setting to use hashed passwords everywhere, so my passwords in this table are, of course, hashed.

Fri, 11/15/2019 - 02:13


I tried playing around with settings, by editing /etc/mysql/conf.d/mysql.cnf and setting skip_name_resolve=ON and restarting the service, but still can't change the password... (same error as above). Suggestions?

Sun, 11/17/2019 - 06:19

When disabling the site again (because it wasn't working anyway):

MySQL database failed! : mysql::execute_sql_logged failed : SQL set password for 'XXX'@'' = '00000000000000000000000000000000000000000' failed : Can't find any matching row in the user table at /usr/share/webmin/ line 1477.

Ideas on a fix? Why has this suddenly broken? Any help appreciated!

Topic locked