Activating database after virtual server import

Greetings

We have had an issue with the import of an existing virtual server. We installed virtualmin on a machine which already hosted several domains with database driven websites. When importing the settings via Add Servers --> Import Virtual Servers we missed entering the database name for one of the domains. Now we are unable to find a way to add the MYSQL feature to this virtual server. When we try to activate the feature the result is an error message saying (correctly) that a database user for this domain already exists.

Is there a way to work around this?

Thank's in advance for your help

Status: 
Closed (fixed)

Comments

A suggestion from my end: It might help to first delete the MySQL user in question in Webmin -> Servers -> MySQL Database Server -> User Permissions, and then trying again to activate the MySQL feature in Virtualmin.

One hack solution would be to fool Virtualmin into thinking that MySQL is already enabled for the domain, as follows :

  1. SSH in as root, and get the domain's ID with the command virtualmin list-domains --domain whatever.com --id-only
  2. Edit the file under /etc/webmin/virtual-server/domains with that ID.
  3. At the end, add the lines :
    mysql=1
    db_mysql=xxxx
   
Where xxx is the name of your existing database.

Once this is done, you will be able to access that DB in Virtualmin.

Indeed, that trick worked

Thank you

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