Troubleshooting
Why cPanel and phpMyAdmin show different sizes for a database
cPanel and phpMyAdmin can show different figures for the same database because the source and the update time depend on the server configuration.
Check how much space the database takes up in cPanel and phpMyAdmin
- phpMyAdmin gets the space allocated to data and indexes from
INFORMATION_SCHEMA. In InnoDB these figures are approximate. - cPanel can get usage from
INFORMATION_SCHEMAor from the server files, depending on the WHM configuration. With the default option it usesINFORMATION_SCHEMA. - cPanel caches the sizes for about four hours.
- In MySQL 8, the table statistics phpMyAdmin queries can stay cached for up to 24 hours with the default configuration.
So an isolated difference does not prove that one of the tools is measuring wrongly, or that the whole difference is recoverable physical space.
Find the large tables
Open the database in phpMyAdmin and sort the tables by size. Check Data and Index separately. The value shown as Overhead comes from DATA_FREE: it represents allocated space that is not in use, but on its own it does not prove how much can be returned to the operating system. In a shared tablespace it may reflect space common to several tables.
Among the tables we have seen grow significantly are wp_actionscheduler_actions and wp_options in WordPress, and ps_layered_filter_block in PrestaShop, although you should always identify which component uses each table before acting.
Before emptying or deleting a table, identify which application uses it and create a backup. The name is not enough to decide that it can be dispensed with.
Recover space without damaging the database
The Optimize table operation should only be considered after deleting a large amount of data and confirming that the table can shrink. In InnoDB it usually rebuilds the table, uses temporary space and generates a considerable disk load. Many InnoDB tables accept writes during part of the process, although brief exclusive locks are needed, and certain indexes or configurations can force the table to be copied and locked for longer. If the table uses a shared tablespace, the operation does not guarantee that the physical file on the server will shrink.
First:
- Create a recent backup and confirm that you can restore it.
- Delete from the application only the data you no longer need.
- Check that there is enough space for the operation.
- Optimise only the affected tables.
The figures have not been updated yet
Wait at least for the next cPanel recalculation, which normally happens every four hours. In phpMyAdmin, MySQL 8 statistics can take up to 24 hours to change.
Do not run Optimize table just to force a counter to update. If the difference persists after those periods, ask for a review stating the database, the figures, the screens where they appear and the time of the check. It can then be compared with live server usage to decide whether the cPanel cache should be refreshed, without asking for credentials.
Always compare the same database, unit and moment: MB and MiB are not equivalent. Do not add up the free space of a shared tablespace once per table. Before a large rebuild, agree a work window and a space margin with support; an outdated counter does not justify putting a working database at risk.
You may also find useful
- Corrupted tables in a MySQL database Confirm a table's error and engine before repairing it, keep a backup and avoid running REPAIR TABLE...
- Error accessing phpMyAdmin from cPanel, Access denied for user Restore access to phpMyAdmin when the error identifies the temporary cPanel user and its MySQL crede...
- Import/export failure in phpMyAdmin Diagnose phpMyAdmin's Missing parameter warnings by renewing the session in a targeted way and revie...
- Joomla 1.5 and 2.5, compatibility with MySQL 8 Deal with unsupported Joomla's incompatibility with MySQL 8 through isolation, inventory and gradual...
Something wrong or out of date? Tell us and we will review it.