sentora-core icon indicating copy to clipboard operation
sentora-core copied to clipboard

MySQL Database Name length Limit

Open xabixab opened this issue 9 years ago • 13 comments

If the client name is too large (More than 15 characters) you can't create databases. I think that database (preffix + database) Max length have to be limited.

Sorry for my bad English.

xabixab avatar Jun 25 '15 22:06 xabixab

We will look into it. After checking their site 64 is the max. @MBlagui @5050 @motters @Caffe1neAdd1ct

TGates71 avatar Jun 26 '15 16:06 TGates71

I think that in phpmyadmin, you only can make one of 16 Characters.

xabixab avatar Jun 26 '15 21:06 xabixab

This is a limit of MySQL not anything else.

There is no workaround other than truncating databases and usernames to the maximum number of characters accepted.

Philip McGaw www.philipmcgaw.com 07969502077

@Philip_McGaw

On 26 Jun 2015, at 22:25, Xabi Xab [email protected] wrote:

I think that in phpmyadmin, you only can make one of 16 Characters.

— Reply to this email directly or view it on GitHub.

PhilipMcGaw avatar Jun 26 '15 21:06 PhilipMcGaw

Apologies if I'm not following 100% on my phone at the minute...

I would suggest truncation is unexpected functionality for a user. Shouldn't the php back end validate the length of the entered data and if not prompt the user for a change which would pass validation?

Might be worth implementing if not already. On Jun 26, 2015 10:50 PM, "Skippy" [email protected] wrote:

This is a limit of MySQL not anything else.

There is no workaround other than truncating databases and usernames to the maximum number of characters accepted.

Philip McGaw www.philipmcgaw.com 07969502077

@Philip_McGaw

On 26 Jun 2015, at 22:25, Xabi Xab [email protected] wrote:

I think that in phpmyadmin, you only can make one of 16 Characters.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/sentora/sentora-core/issues/176#issuecomment-115900355 .

Caffe1neAdd1ct avatar Jun 26 '15 21:06 Caffe1neAdd1ct

And/or perhaps you could have a limit for both usernames and mysql names, configurable in settings.

KaidenP avatar Jun 27 '15 02:06 KaidenP

There shouldnt not be a trucation on username the php needs to validate it. personally i dont think you should be restricting usernames to 16 chars more appropriate would be 24 or 30 then. then if the user name is longer than the prefix amount allows create a short name.

use tge short name where all user prefixes occur or just db names but ahort user down add ~1,~2 to the end of user incase of duplicate shortnanes

eByte23 avatar Jun 27 '15 04:06 eByte23

should not truncate*

eByte23 avatar Jun 27 '15 04:06 eByte23

The length limit is a feature of MySQL.

how would hiding the truncation from the user help? They would need to enter the "short name" in any application they install… the long name is meaningless.

This is a hard limit and can not be configured out.

If you feel that it should be changed ask oracle to change it in MySQL.

Philip McGaw www.philipmcgaw.com 07969502077

@Philip_McGaw

On 27 Jun 2015, at 05:49, Elijah Bate [email protected] wrote:

should not truncate*

— Reply to this email directly or view it on GitHub.

PhilipMcGaw avatar Jun 27 '15 05:06 PhilipMcGaw

I think that your idea is a good one @ebyte123, but it should be a 2 or 3 digit hexadecimal, or an alphanumeric, preferably randomly generated.

Or, building on what @PhilipMcGaw suggested, we have a unique id for each user, and whenever sentora encounters this, it resolves it to a human friendly name, similar to what Linux does with uid's. However, this would require some major changes in the code, and probably wouldn't be backwards compatible.

KaidenP avatar Jun 27 '15 06:06 KaidenP

as we should have a prefix in mySQL user this would be an issue agree. The input field for user name should be truncated to MAXuser length allowed by MySQL/mariaDB minus current user name. We should also limit a bit user names length so we don't have bugs popping up as we implement prefixes everywhere. ( MySQL user / FTP ).

When limiting max char in input box we will not truncate, that will require more control for the valid user length here entered and append the user prefix ( name ) so we remain in mySQL allowed limit.

Also we should limit user name. 12-16 ( CPANEL already do that and now you see why!).

Set MySQL user name as : user + name set by user ( zadmin_wp ) .

Setting up a random prefix is not a solution that must users may love or we assign that a random unique prefix for each user of 3-4 characters that will be then used for all prefixes.

M B

MBlagui avatar Jun 27 '15 11:06 MBlagui

Maybe change the prefix to the UID like other services do? This is normally much smaller than an actual user name prefix. This will still group DB names together and a simple module could be made to convert UID_DBNAME to USERNAME_DBNAME for reference purposes for the sysadmin.

TGates71 avatar Jun 29 '15 15:06 TGates71

@TGates71 I think that is a good idea.

xabixab avatar Jun 29 '15 16:06 xabixab

The upgrade of existing applications would need to be thought about carefully as changing a load of database names would stop all applications working until their configurations have been updated.

Using the UserID would shorten the database name lengths :+1: Not truncating, alert the user and ask for a shorter database name on creation attempts

Any other ideas to add to MySQL database functionality?

Caffe1neAdd1ct avatar Sep 28 '15 11:09 Caffe1neAdd1ct

V.2.0.0 deals with this issue by limiting username. MySQL has a limit before 5.7. Sorry not a Sentora issue! Closing for now.

Dukecitysolutions avatar Jan 11 '24 21:01 Dukecitysolutions

Also, could set the username field only accept x characters including the prefix.

TGates71 avatar Jan 12 '24 01:01 TGates71

Tom, let me know when’s it’s done!

Dukecitysolutions avatar Jan 12 '24 03:01 Dukecitysolutions

Max characters has already been completed. I just tweaked it a bit to include user name prefix for the db user name. Will send you the code.

TGates71 avatar Jan 23 '24 03:01 TGates71