Most cPanel database backups produced by mysqldump with default options are technically restorable but operationally hostile. The default locks all tables across the dump (FLUSH TABLES WITH READ LOCK), which on a busy InnoDB host means every write blocks for the duration of the dump. The default also omits triggers, events, and routines, captures inconsistent state across InnoDB and MyISAM tables, and produces inserts in batches small enough that the restore takes ten times longer than it should. The fix is six flags, not a rewrite.
What’s happening
mysqldump was originally written for MyISAM, where global locking was the only way to get a consistent snapshot. On InnoDB, --single-transaction uses an MVCC snapshot — no locks, consistent view, dump runs against live data. But the default in most distributions is still the legacy lock-based behavior, because mysqldump cannot tell whether you actually need it. The other defaults — no routines, no events, conservative max_allowed_packet — are similarly tuned for caution rather than for the common case.
The corollary: a dump from mysqldump without flags is almost never what you want for a live cPanel account.
How to verify
mysql -e "SHOW VARIABLES LIKE 'max_allowed_packet'"
mysql -e "SELECT ENGINE, COUNT(*) FROM information_schema.TABLES WHERE TABLE_SCHEMA='acmecorp_wp' GROUP BY ENGINE"
mysql -e "SHOW TRIGGERS FROM acmecorp_wp"
mysql -e "SHOW PROCEDURE STATUS WHERE Db='acmecorp_wp'"
The packet size matters for the dump command (you’ll match it). The engine breakdown tells you whether --single-transaction is safe to use — it requires InnoDB on every table; if you have one MyISAM table, the dump is inconsistent. The trigger and procedure counts tell you whether you need --routines and --triggers (you almost certainly do).
The fix
The dump command for a cPanel account database, copy-pasteable:
mysqldump \
--single-transaction \
--quick \
--routines \
--triggers \
--events \
--hex-blob \
--default-character-set=utf8mb4 \
--max_allowed_packet=512M \
-u acmecorp_wp -p acmecorp_wp \
| gzip > /home/acmecorp/backups/acmecorp_wp-$(date +%F).sql.gz
What each flag does:
--single-transaction: starts a transaction at dump time and reads everything from that snapshot. No write locks. Requires every table to be InnoDB; if you have MyISAM, convert it first (separate article) or accept inconsistency on those tables.--quick: streams rows from the server to the client instead of buffering the entire result. Essential for tables larger than RAM.--routines --triggers --events: includes stored procedures, functions, triggers, and the event scheduler entries. Default is to silently drop all four.--hex-blob: encodes binary columns as hex literals. Avoids charset-related corruption of binary data on restore.--default-character-set=utf8mb4: forces the connection to utf8mb4 so four-byte characters (emoji, certain CJK) survive. Default depends on server build and is oftenlatin1orutf8, both of which silently truncate.--max_allowed_packet=512M: lets mysqldump send larger statements. If a single row exceeds 16MB (the default), the dump fails halfway with no obvious error.
Restore with the matching flag set:
zcat acmecorp_wp-2026-05-19.sql.gz | mysql --max_allowed_packet=512M acmecorp_wp
For automated, schedule-driven backups across many cPanel accounts, Stack Harbor’s environment management team wraps this command set into a per-account script with rotation, off-host upload, and a quarterly restore drill.