error too long only 16 characters of the username or password for mysql

I had an error with virtualmin not accepting more than 16 characters of the username or password for mysql, this crashed the creation of new VH. With error on
/usr/share/webmin/virtual-server/feature-mysql.pl

Fixed with a small addition after this line

my ($host, $user, $encpass) = @_;

my $user = substr $user, 0, 16; #added to avoid crash add this line here!

Hi,

There are known character limits for some services like MySQL.

I recommend adopting a simple username schema like:

u1000, u1001, etc

Sure, this naming schema seems cryptic, but it will work across most services without issues, or truncation.

When we setup Virtualmin we use a schema like above, and then setup the home directories to be the name of the domain like:

Username: u1000
Home Directory: /home/domain.com/

If you need assistance setting up your server with optimal settings, please free to fire me an email.

Best Regards, Peter Knowles TPN Solutions

Email: pknowles@tpnsolutions.com