A customer’s WordPress staging site is named acmecorp_wordpressstagingv2_2026Q2 — a perfectly reasonable name. The import into their cPanel account fails: “Identifier name too long.” The cPanel UI silently truncated the name on the way in, the dump file references the full name, and now the schema doesn’t match. The root cause is cPanel’s 8-character account prefix plus an underscore eating into MariaDB’s 64-character identifier limit. Most developers don’t know about this, and the import error doesn’t explain it.
What’s happening
MariaDB and MySQL have a 64-character limit on identifier names (database, table, column). cPanel adds a prefix of <account>_ to every database name an account creates. The account username itself has a 16-character cPanel limit on older versions and 8 on legacy ones, but historically cPanel reserved space for an 8-character prefix.
So for an account named acme, a database called wordpress becomes acme_wordpress (14 chars total). For an account named acmecorp (8 chars), the same database is acmecorp_wordpress (18 chars). And the maximum safe short name is 64 - len(account) - 1 (for the underscore).
Real-world breakdowns:
- 8-char account: max database short name is 55 chars (
acmecorp_is 9, leaving 55). - 4-char account: max database short name is 59 chars.
- Plus the same limits on table, column, index, and constraint names — within the database, identifiers can be the full 64 chars.
The trap: an import from a non-cPanel server that has a database called customer_engagement_v2_archive_2026 (33 chars) breaks when imported under an 8-char account because the resulting acmecorp_customer_engagement_v2_archive_2026 is 42 chars — fine. But if a developer tries acmecorp_customer_engagement_v2_archive_2026_extended (52 chars), they’re at 52 + 9 = 61. Adds three more chars and they break the limit.
How to verify
echo "acmecorp_wordpressstagingv2_2026Q2" | wc -c # length check
mysql -e "SELECT TABLE_SCHEMA, LENGTH(TABLE_SCHEMA) AS schema_len FROM information_schema.SCHEMATA ORDER BY schema_len DESC LIMIT 10"
mysql -e "SELECT TABLE_NAME, LENGTH(TABLE_NAME) AS name_len FROM information_schema.TABLES WHERE TABLE_SCHEMA='acmecorp_wp' ORDER BY name_len DESC LIMIT 10"
whmapi1 list_users | head
The first checks an individual name. The second and third audit existing identifiers — anything near 64 is a future problem. The user list reminds you of the account names you’re working with.
The fix
- Plan database short names with the prefix in mind. Before requesting a database from a customer, calculate
64 - len("acmecorp") - 1 = 55and stay well below that — leaves room for the account prefix changing or for renames. - For imports from external systems, rename the source database to a cPanel-compatible short name before exporting:
Wait — MySQL doesn’t have RENAME DATABASE. So instead, dump with the original name, thenmysql -e "ALTER DATABASE long_database_name_for_archive_2026 RENAME TO short_arch_2026"sedthe dump to use a new name:
Two passes because some references are backtick-quoted and some aren’t. Import the renamed dump under the cPanel account.sed -i 's/`long_database_name_for_archive_2026`/`short_arch_2026`/g' export.sql sed -i 's/long_database_name_for_archive_2026/short_arch_2026/g' export.sql - For tables and columns, the 64-char limit is per identifier independent of prefix. A table called
wp_extremely_long_table_name_for_test_data_2026_q2_archive(52 chars) is fine. Stay under 60 for safety. - For foreign key constraint names, MySQL uses the format
<table>_ibfk_N. If your table name is 55 chars, the constraint name is 55 +_ibfk_1= 62 — just under. With 60-char tables, the constraint names start exceeding. Name your constraints explicitly to control length:CONSTRAINT fk_short_name FOREIGN KEY (col) REFERENCES other(id) - For utf8mb4 indexes, the byte limit (767 bytes pre-5.7, 3072 bytes after with
innodb_large_prefix) applies. A 255-char VARCHAR in utf8mb4 is 1020 bytes — needsinnodb_large_prefixand DYNAMIC row format. See the utf8mb4 migration article. - For ALTER and CREATE failures with “Identifier name too long”, count the characters. The fix is renaming, not raising limits — MariaDB does not let you exceed 64.
- For account renames (
whmapi1 modifyacct), every database name changes. If the new name is longer, you may exceed limits on previously-fine databases. Auditinformation_schema.SCHEMATAlengths before the rename.
For environments where database naming is reaching the limit across many accounts, Stack Harbor’s cPanel server management team standardizes naming conventions in onboarding and audits identifier lengths during takeover.