MYSQL user name


Is there any way to have an option to use UID (system user ID, a number under Linux, like 1001) as a user name for the database that is created during the site initialization?

The reason for this is that Mysql has a limit of 16 characters for a user name. If I choose to have the user name to be the same as the site name and the site name is too long, the name will not work or will be truncated. If I have two separate sites, such as:

the user names will be the same, as in "my-great-site-to", which is definitely not what I want and I lose tracking of user name correlation to the site name.

With UID as the database user, all I have to do is look up the UID of the site’s owner, like this [ id -u ]

I am currently using a script that creates a database with UID as the user (owner) but the problem with it is that Webmin/Virtualmin is completely unaware that the database owned by a particular user UID belongs to whatever site that was created, there is no relationship there.
Hence, a need to have an option in Webmin/Virtualmin for UID as the owner/user name for the database.

Any pointers/suggestions will be appreciated.


One simple solution would be to select a different (shorter) username for the domain at creation time. This can be done on the Create Virtual Server page, in the ‘Administration username’ field. So you could enter ‘buy’ and ‘sell’ in your two examples.

This then applies to the Unix username, Virtualmin login and MySQL login…

Joe, it depends :wink:

If you’re a hosting company, you prefer a solution that will prevent your customers to call you each time they create a virtual server. I know they can put a sticky on the side of their screen: “Remember, when domain name without tld > 16 characters, truncate MySQL login to 16 characters.”, but they won’t :smiley:

Even the server administrator will probably forgot if he doesn’t often create > 16 characters long virtual servers and doesn’t often face this issue.

I opened a bug issue:

This solution with UID would help us too. Or just increase limit from 16 to 32 chars for actual versions of MySQL, which support it (for MariaDB it is 80 chars). We truly need it.