Were you able to
find a solution today?

5 seconds No email needed

Thanks-that genuinely
helps.

Want us to follow up with an answer or a custom quote? Drop your email below. Totally optional.

Email saved - thank you!

Understanding the size of your MySQL databases is critical for effective server management, resource allocation, and performance tuning. Whether you're auditing disk usage, planning backups, or troubleshooting load issues, having visibility into database size helps you make informed decisions.

For Linux-based hosting environments, you can easily check database size either through the phpMyAdmin interface or using direct SSH access with SQL queries. Both methods provide accurate insights—phpMyAdmin offers a quick visual check, while SSH commands give you precise control and filtering capabilities for deeper analysis.

This guide covers both approaches and helps you identify database or table-level size metrics without relying on third-party tools.

Checking MySQL database size from phpMyAdmin:

Step 1: Log in to cPanel. Skip this step if you have installed the MySQL Database in Windows. You can directly open phpMyAdmin using server IPaddress:8080

Step 2: Click on phpMyAdmin.

Step 3: Select the database whose size you want to check.

Step 4: Go to the size column. At the end of the column, you can view the size of that database as per the image below.

Checking MySQL database size via command:

Step 1: Log in to SSH using root.

Step 2: Enter MySQL using the following command.

# mysql -u username -p

MySQL username will be root

Step 3: Enter the password once the password prompt appears.

Step 4: Copy/paste the below command to display all the databases with their size in MB.

# SELECT table_schema AS "Database",ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) 

AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema;

If you are looking to display the size of a single database. Change the database name to your database.

# Select table_schema `Database`, Round(Sum(data_length + index_length) / 1024 / 1024, 1) 

`Size in MB` FROM information_schema.  TABLES WHERE table_schema = 
‘Databasename’;

If you are looking to display the size of a single database along with its tables. Change the database name to your database.

# SELECT table_name AS "Table", ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" 

FROM information_schema.TABLES WHERE table_schema = "database_name" ORDER BY (data_length + index_length) DESC;

Conclusion:

Regularly monitoring your MySQL database size ensures that you’re staying ahead of resource limits, optimizing performance, and avoiding unexpected server issues. Whether you're a developer, sysadmin, or hosting provider, staying aware of growing database footprints is essential for maintaining healthy infrastructure.

Efficient database management starts with visibility. By mastering both GUI and CLI methods, you ensure no surprises when your storage hits its limits.

Was this answer helpful? 1 Users Found This Useful (2 Votes)