Prepending db names

I have been trying to set up a template so that when a database is created, it prepends the name with the user’s user name. I have been able to get this to work when Virtualmin creates the default database, but not when that user creates his or her own databases. I have entered “${USER}_” into the box beside of “Prefix for additional databases,” but it doesn’t work.

BTW, the documentation goes line by line how to set up a template, but skips right over this setting. Can somebody look into that?

Am I to just figure this out on my own? Is there noone here who knows the answer? Maybe that’s why it was left out of the documentation. It must work on the Pro version, can’t somebody just tell me what to do to make the opensource version work?

This feature is the same in Virtualmin GPL and Professional. There is no conspiracy. If it doesn’t work in GPL, it doesn’t work in Pro, and filing a bug is the appropriate action. :wink:

I believe underscore is explicitly prohibited (for some reason I don’t recall, but it’s a good reason). But, it ought to complain about the problem rather than silently not working. Do you get an error?

But, wait a minute…the default is the behavior you describe (without you having to setup anything in the Server Templates). How are your users creating databases? Are they using Webmin/Virtualmin? (That’s the only place we can enforce this. If you’re allowing arbitrary database creation in MySQL, there’s nothing we can do about the names they choose.)

OK, I’ve done a little more research on this and found that if I set up the template to prefix additional databases with the username_, and create a database using the “Edit Databases” button on the vertual server page while logged in as root, it actually does prepend the database name with the username. When I log out and log back into Webmin with a user’s login, and then try to create a database, the name of the database is not prepended at all.

Any ideas how to correct this, or do I need to ask the Webmin guys?

Sounds like a bug. File it in the tracker, and we’ll see what Jamie has to say about it.

Any ideas how to correct this, or do I need to ask the Webmin guys?

What "Webmin guys" would that be? Jamie and Joe, perhaps? (Hint: We are the Webmin guys. Jamie mostly.) :wink:

Sorry, I’m new to Webmin/Virtualmin so I didn’t know. I will file the bug forthwith. I’ll just tell my customers to prepend the db names manually for now.

Thanks much for the help.