Understanding Database Quotas
Your hosting plan includes a specific allocation for MySQL databases. Understanding how database size is measured, monitored, and managed helps you avoid hitting limits that could impact your website's functionality.
How Database Limits Work
Your hosting account may have limits on:
- Number of databases - The maximum number of separate MySQL databases you can create.
- Total database storage - The combined disk space used by all your databases, counted toward your account's overall disk quota.
- Individual database size - Some plans may set a per-database size limit.
Checking Database Size
You can check your database sizes in several ways:
Via DirectAdmin:
- Go to MySQL Databases in DirectAdmin.
- The database list shows the current size of each database.
Via phpMyAdmin:
- Log in to phpMyAdmin.
- Click on the database name in the left sidebar.
- At the bottom of the table list, you will see the total database size.
- Each table's size is listed in the Size column, along with any Overhead.
Via SQL query:
SELECT table_name AS 'Table',
ROUND(((data_length + index_length) / 1024 / 1024), 2) AS 'Size (MB)'
FROM information_schema.TABLES
WHERE table_schema = 'your_database_name'
ORDER BY (data_length + index_length) DESC;
Reducing Database Size
If your database is approaching its limit, try these strategies:
- Clean up unused data - Remove old log entries, expired sessions, spam comments, and post revisions.
- Optimize tables - Run the OPTIMIZE TABLE operation to reclaim fragmented space.
- Archive old data - Export and remove data you no longer actively need but want to keep for records.
- Review plugins - Some plugins (analytics, logging, caching) store large amounts of data. Disable or clean up plugins you no longer use.
- Purge transients - WordPress transients stored in
wp_optionscan accumulate significantly over time.
Monitoring Growth
Keep an eye on database growth by periodically checking sizes in phpMyAdmin. If your database is growing faster than expected, investigate which tables are largest and determine if the growth is normal or caused by a runaway process.
Database size is included in your account's total disk usage. If you are running low on disk space, check both your file storage and database sizes to identify where the space is being used.
If your database reaches its size limit, applications may be unable to insert new data, which can cause errors on your website. Monitor your usage regularly and upgrade your plan if you consistently need more database storage.