Submitted by gordon on Wed, 03/25/2015 - 10:00 Pro Licensee
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
Gordon
Status:
Closed (fixed)
Comments
Submitted by JamieCameron on Wed, 03/25/2015 - 12:17 Comment #1
MySQL has a hard-coded limit of 16 characters on usernames - so there isn't anything Virtualmin can do to make it longer.
Submitted by gordon on Wed, 03/25/2015 - 13:41 Pro Licensee Comment #2
ok, I understand, but then why or how is virtualmin creating user details in excess of 16 characters?
Submitted by JamieCameron on Wed, 03/25/2015 - 18:54 Comment #3
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.
Submitted by gordon on Thu, 03/26/2015 - 02:01 Pro Licensee Comment #4
This is what I find strange,
When we create a subdomain we are given admin credentials by virtualmin; Administration login client.domain.co.za 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.
Submitted by JamieCameron on Thu, 03/26/2015 - 18:58 Comment #5
The cause may be that MySQL allows logins using usernames above 16 characters, as long as the first 16 are correct.
Submitted by Creapix on Mon, 11/14/2016 - 15:04 Comment #6
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.
Submitted by JamieCameron on Tue, 11/15/2016 - 18:58 Comment #7
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 linemysql_user_size=80
Submitted by JamieCameron on Tue, 11/15/2016 - 18:58 Comment #8