Limit administration username to 16 characters to keep consistent with MySQL username limitation

Sometimes users create quite long domain names, which is ok for automatically generated administration usernames and database names, however it is not ok for respective MySQL user also automatically generated, which has access to the respective database.

So to replicate please create a virtual server with domain name 1234567891011121314151617181920.com and it will give:

Creating administration group 1234567891011121314151617181920 ..
.. done
Creating administration user 1234567891011121314151617181920 ..
.. done
..................some other irrelevant to this post entries here...................
Creating MySQL login ..
.. done
Creating MySQL database 1234567891011121314151617181920_1234567891011121314151617181920 ..
.. done

But if you try to connect with username '1234567891011121314151617181920' to database '1234567891011121314151617181920_1234567891011121314151617181920' with correct password you'll fail simply because MySQL applies its own limitation to username length to 16 characters. Thus the respective MySQL username which has access to the database is '1234567891011121'. Now we need to deal with confused users who can't easily figure out why their applications fail to connect to database.

So to avoid this problem I suggest to make Virtualmin limit the administration usernames for virtual servers to 16 characters as well or to automatically change default limitation of MySQL for it to accept longer usernames. To me 16 character is more than enough.

Thanks to considerations!

Status: 
Closed (fixed)

Comments

Users can see the shorter MySQL username that was chosen on the Edit Databases page. Limiting the regular login is tricky, as it introduces problems when similar domains exist on the system, like somethingsomething.com and somethingsomething.net .

That said, you can impose a limit at Webmin -> System -> Users and Groups -> Module Config -> New user options -> Maximum user and group name length.

That said, you can impose a limit at Webmin -> System -> Users and Groups -> Module Config -> New user options -> Maximum user and group name length.

This addresses my concern. Thanks!