Random mysql database permissions missing

Hi Guys,

I woke this morning to a client telling me that their website was saying that it was unable to connect to their mysql database. I had not been on the host that evening so I couldn't have accidentally erased the permissions for their database. I logged into virtualmin to look around and sure enough their database was missing from the mysql permissions area. I checked the webmin logs for the mysql module and was unable to find any fat finger mistakes by me or anyone else.

Have you heard of this happening? Is there a way to find a log in virtualmin/webmin that would show when the permission entry was removed and by who?

Thx,

~Jeremy

Status: 
Closed (fixed)

Comments

That is unusual ... the only way I can imagine permissions disappearing like that is if the database was disconnected from the domain in virtualmin.

You can check at Webmin - Webmin Actions Log to see if anyone performed that action at or before the time the problem was detected.

Hi Jamie,

I checked for the past week for all users on all modules and I don't see anything on the 28th or 29th that would have caused this.

The attached image might be helpful to spot something such as my cloning and renaming of the vital-soft.com sub-servers. However, not sure how that might affect the main server.

A side note, the database did show up when I logged in with the vital-soft.com admin user into webmin this morning, so the ownership had not changed, when I tried to manage it, it said I did not have permissions. This is what tipped me off to check the MySQL database permissions.

I will make sure to report any more occurrences so we can get to the bottom of it. At this point I am going to say it is a fluke. The only other thing that occurred last night was an incremental virtualmin backup of the client.

Hope you have a great day,

~Jeremy

Ok, I see the cause of this now - if you clone a sub-server, there is a Virtualmin bug that can cause DB access by the domain owner to databases other than those in the clone to be removed!

The work-around until the 3.89 release is to edit /usr/share/webmin/virtual-server/feature-mysql.pl and change lines 642-643 from :

local @allowed = &get_mysql_allowed_hosts($oldd);
&save_mysql_allowed_hosts($d, \@allowed);

to :

if (!$d->{'parent'}) {
  local @allowed = &get_mysql_allowed_hosts($oldd);
  &save_mysql_allowed_hosts($d, \@allowed);
  }

Then run /etc/webmin/restart

Shazbot!!

Thx for the info. I will make sure to apply that patch!

Good catch Jamie.

Hope you have a great weekend,

~Jeremy

Automatically closed -- issue fixed for 2 weeks with no activity.