Unable to create a database issue

wickedmx

Registered
May 4, 2008
4
0
51
I have run into a serious bug since recently upgrading my 3 servers to WHM 56. The issue affects any cPanel account that was created with a username longer than the traditional 8 characters and results in the following occurring:

1) When trying to use Installatron to install an application, the installation fails with the following error (example only):

Error
Unable to create a database. Check that your hosting account has at least one database available. If it does, please contact your host.

Technical Error: The database “xxxxxxxxxxxxxx_afmo1” already exists.
`xxxxxxxx_afmo1'

2) If then try to manually install the application; the creation of a database works just fine, but when I then try to run the application's installation process, it complains that it cannot connect to the database even though all details are entered correctly.

I have tested the process across 3 servers, all running WHM 56 (Build 14) and MariaDB 10.0.25, with the same results. I have also tested installing different applications, again with the same result.

Accounts that were created with the traditional 8 character limit are unaffected as their cPanel and MySQL/MariaDB usernames match up.

Any advice on a fix for this?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello,

MySQL username limits are documented at _MySQL Username Limit - Documentation - cPanel Documentation :
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 up to 13 characters long.
  • A MySQL database with the example_ prefix allows usernames up to 8 characters long.
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 up to 44 characters long.
  • A MariaDB database with the example_ prefix allows usernames up to 39 characters long.
This seems like an issue with the specific plugin you are using, if that's the only time you notice the issue. Have you verified that the servers are using the latest version of the Installatron plugin, and if so, have you reported the issue to their support team?

Thank you.
 

wickedmx

Registered
May 4, 2008
4
0
51
Thanks for the reply Michael, however, the issue is not specific to Installatron as it also occurred when attempting a manual installation completely independent of Installatron.

After looking at the documentation, the only way around this I believe is to disable the inclusion of the username prefix for new databases. However, on a shared server this is not ideal as the username at the front makes it much easier to manage a large number of databases across many users.

The problem only exists for accounts that are manually created via WHM, as this defaults to the newer naming protocol that allows usernames up to 16 characters. So this is mostly affecting resellers that are still using the WHM account creation process.

Is there a way to force cPanel to only create users with the previous 8 character limit?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Thanks for the reply Michael, however, the issue is not specific to Installatron as it also occurred when attempting a manual installation completely independent of Installatron.
Could you provide us with a method to reproduce the issue that does not involve a third-party application? Or, are you stating that any database creation attempt outside of our API or user-interface results in this issue?

Thank you.
 

Stefanfan

Registered
Jun 17, 2016
1
0
1
NSW, Australia
cPanel Access Level
Reseller Owner
Could you provide us with a method to reproduce the issue that does not involve a third-party application? Or, are you stating that any database creation attempt outside of our API or user-interface results in this issue?

Thank you.
I ran into this issue today, as well.
1. Use WHM to create an Account manually, using more than 8 characters for the username.
2. Log on to cPanel for the Account you created
3. Install WordPress with the default options.
The installation fails early with the error described above.
I worked around the issue by terminating the account I had created, and then re-creating it with an 8-character username.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
1. Use WHM to create an Account manually, using more than 8 characters for the username.
2. Log on to cPanel for the Account you created
3. Install WordPress with the default options.
The installation fails early with the error described above.
I'm unable to reproduce this issue when installing WordPress via the "Site Software" option in cPanel. Could you clarify if you are using a third-party application such as Installatron to install WordPress? I've seen reports of this problem for other control panels on the Installatron forums and the issue was resolved by the Installatron development team.

Thank you.