I noticed that I can’t outright add database users through the Virtualmin backend (I’m using the GPL version) but I wanted to know if I can still add them through something like phpMyAdmin, the raw MySQL command, or even the API command I found in the documentation?
For some reason, the command went through but the user was created as just “games@mydomain.com” without the underscore.
I found this 15-year-old thread which talks about adding a user but it goes about it a weird route that doesn’t track with what I see in Virtualmin today.
You can add users however you want. If you’re root, the Webmin MySQL/Mariadb module allows adding users, and anything else you want to do.
Virtualmin Pro allows domain owner users to do somewhat more advanced things with databases, as well, including users. But, you’re root and it’s your server, so you have no limitations anyway.
As for the underscore, I’m assuming that’s invalid for some reason (though I can’t think of why), though it should have given an error instead of truncating it, if so. We’ll have to look into that.
@Jamie - Why would create-user truncate the username myd_games to games?
I think this settles 99% of my questions. I just wanted to make sure that if I do something on the side away from the Virtualmin GUI that it doesn’t break something within Virtualmin.
Virtualmin is designed to try really hard to respect whatever you do on the command line or using other tools (though those tools must operate directly on the config files, like Webmin does and like Virtualmin mostly does…anything the overwrites configuration files from templates is going to break everything, and should be avoided).
One caveat I should have mentioned is that if you create users outside of Virtualmin, they won’t be included in Virtualmin backups, unless you create them in a way that Virtualmin recognizes as being associated with the domain…a system user that has the group set to the that of a domain and has its home in /home/domainname/homes will be included in backups, but any other sort of user will not. I don’t think there’s a way to make extra database users associated with a domain, though…you can associate databases created outside of Virtualmin with a domain by telling Virtualmin to import it, but I don’t think there is such a facility for users.
So, make sure you have system backups in addition to Virtualmin backups, if you’re doing things in unusual ways. (That’s good advice, anyway.)
Oh I see - so in that case you don’t generally need to add it as part of the username, as Virtualmin will append or prepend it automatically when needed.