Mysql username being cut to 16 characters

I have a problem when editing mysql users and saving password changes. Once saved the username is cut to 16 characters. The original username is created by virtualmin and is usually created much longer than the 16 character restriction.

How do I increase the number of characters to restore my sql users credentials?

I am using virtualmin 4.15 and webmin 1.740

Thank you


Closed (fixed)


MySQL has a hard-coded limit of 16 characters on usernames - so there isn't anything Virtualmin can do to make it longer.

ok, I understand, but then why or how is virtualmin creating user details in excess of 16 characters?

Are you sure Virtualmin is creating MySQL logins that are bigger 16 characters? You can check by going to Webmin -> Servers -> MySQL Database -> MySQL Users.

This is what I find strange,

When we create a subdomain we are given admin credentials by virtualmin; Administration login Administration password xxxxxxxxxxxxxx

When we use these details for mysql, they work fine, ie username longer than 16 characters. When I go to the mysql server under webmin the username is reflected to a max of 16 characters. As soon as I edit the user and save the password, my login credentials no longer work and I have to then update all my scripts to use the shortened username.

As an FYI, this server has been running for 5 years, maybe this is a historical carry over...

I will ensure that we use the 16 character limit in future.

The cause may be that MySQL allows logins using usernames above 16 characters, as long as the first 16 are correct.

Hi, we need longer MySQL username than 16 chars. But is seems that virtual min cut domain name only to 16 chars. We haven't found option to change it. We use MariaDB, which provides option to have username 80 chars long. We dont want virtualmin to cut it and username must be right created by virtual server creation. Please help.

It looks, that username can be more than 16 characters nowadays.

The next release of Virtualmin will at initial install detect the size of the "user" field in the mysql.user table, and use that as the limit instead of hard-coding 16. However, this will not apply to existing installs because it could cause existing 16-char limited usernames to be disassociated from their users.

However, you will be able to force the new limit by editing /etc/webmin/virtual-server/config and adding the line mysql_user_size=80

Status: Active ยป Fixed