how to change maximum length of MySQL user from 16 characters to 32?

6 posts / 0 new
Last post
#1 Wed, 09/17/2014 - 04:47
slkgroups

how to change maximum length of MySQL user from 16 characters to 32?

i am trying to host both mydomain.com and mydomain.net where mydomain is 15 characters long. virtualmin will not let the second domain be set up- stating that MySQL already has a use called mydomain. - it is truncating the com and/or net off. the last time i had to set up a fresh system was 7-8 years ago, and i have forgotten where i made the last piece of correction. i have changed the user field in the db database- but it appears that some where else the user name is truncated before it attempts to enter user name to db.

i am at a loss to find this last missing step. keith

Thu, 09/18/2014 - 10:17
nodo50

Hi, you can't change the limit. From http://dev.mysql.com/doc/refman/5.5/en/user-names.html

MySQL user names can be up to 16 characters long. Operating system user names, because they are completely unrelated to MySQL user names, may be of a different maximum length. For example, Unix user names typically are limited to eight characters. Warning

The limit on MySQL user name length is hard-coded in the MySQL servers and clients, and trying to circumvent it by modifying the definitions of the tables in the mysql database does not work.

I seem to remember in MySQL 5.0 and prior, if you try to connect from client using a long username, the MySQL server takes only the first 16 characters and the login process works. Since MySQL 5.1 the login fails if you send more than 16 characters in username from the client (php code, mysql cli, phpmyadmin login form...).

You can try providing a personalized username when setting up the second domain, instead mydomain.net you can use adminmydomain.net or something like that.

Santi

Mon, 11/14/2016 - 15:46
Creapix

This probably has solution now. New verisons of MySQL support 32 chars (MariaDB even 80 chars)

Creapix

Sun, 12/24/2017 - 14:00
amrod

how do we change MySQL user from 16 characters to 80?

Mon, 12/25/2017 - 03:42
Creapix

I'm on mobile now and I don't remember it exactly but it is possible to change it by adding parameter to config file. New verisons support this option. When we were solving this problem there wasn't this parameter option.

Creapix

Mon, 12/25/2017 - 03:46
Creapix

Here it is. Edit /etc/webmin/virtual-server/config and adding the line mysql_user_size=80

Creapix

Topic locked