SOLVED Account restoration mysql username too long

MarkoTitel

Member
Nov 29, 2015
10
1
3
Novi Sad
cPanel Access Level
Root Administrator
Hi,

I have a fully working WHM server with backups setup and working.

I have installed a TRIAL WHM licence on another server to test the backups just now.

I am following simple restoration process:

- Put the archive in the /root
- Restore the account from WHM

Issue I am facing is that I get a Warning message that MYSQL username is too long, and it was not created.

Also when I check the database prefix on the new server, it is not the same as on the old one. It is shortened by few characters.

Both WHM versions are the same. 64 (build 12).

Anyone had these issues?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
Hello,

Is "Require a username prefix on names of new databases and database users" enabled under the "SQL" tab in "WHM >> Tweak Settings" on this system? Also, could you let us know how long the account and database usernames are?

Thank you.
 

MarkoTitel

Member
Nov 29, 2015
10
1
3
Novi Sad
cPanel Access Level
Root Administrator
Hi, thanks for quick reply

It is enabled on both servers. Both servers are same version.

Database username is 19 characters long on the server that is in production.

Cpanel username is 15 chars long.

If char number is restricted how come on the working server I never got a warning and DB creation works fine.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
Database username is 19 characters long on the server that is in production.

Cpanel username is 15 chars long.
Hello,

Documentation on this topic is available at:

_MySQL Username Limit - Documentation - cPanel Documentation

Here's a quote from this document:

MySQL limits the database username to 16 characters. The system includes the database prefix (the first eight characters of the cPanel account's username and an underscore character) in the character count for the username. For example:
  • A MySQL database with the db_ prefix allows usernames that contain up to 13 characters.
  • A MySQL database with the example_ prefix allows usernames that contain up to eight characters.
Is the server where the username was created using MariaDB? If so, you may want to upgrade the destination server to use MariaDB, as it allows for longer usernames:

MariaDB limits the database username to 47 characters. The system includes the database prefix (all of the cPanel account's username and an underscore character) in the character count for the username.

For example:
  • A MariaDB database with the db_ prefix allows usernames that contain up to 44 characters.
  • A MariaDB database with the example_ prefix allows usernames that contain up to 39 characters.
Thank you.