MySQL username too long but I am using MariaDB

Hi I am migrating vitualmin to a new server but I receive an error saying that the username of MySQL is too long but I am using MariaDB and it shouldn't have username limits.



Ilia's picture
Submitted by Ilia on Fri, 04/10/2020 - 05:04


This is the limitation of MariaDB 5.5 itself. For example, MariaDB 10 allows really long usernames.

I don't know what to recommend, really. As MySQL itself holds its data using datatable named "mysql", I could easily tweak this limitation, by simply editing field "User" In table "user" in database "mysql", and changing the length from 16 to 128. I cannot guarantee that it will survive updates or won't break anything in the future, however, I have pretty confident expectations that it won't be a problem MySQL-wise. However, it's coupled with Virtualmin on the core, and for your information, you would also need to manually set "mysql_user_size=128" to Virtualmin "config" file under "/etc/webmin/virtual-server".

Nevertheless, I would like to warn you, that these are only my expectations and, for instance, Jamie, on the other hand, doesn't recommend doing it in this post, saying:

.. this will not apply to existing installs because it could cause existing 16-char limited usernames to be disassociated from their users.

I am not sure why this would happen, and that post 4 years old, and it worked on my end in my debug environment, but I urge you to try it only if you feel confident that you would be able to fix any possible, upcoming mess without contacting us. :)

I would also be careful about extending the default MySQL or MariaDB username length, as you could end up creating a virtual server that can't be restored on another system.