How to Check Size of Website Database?

As a website owner, you always manage the resources to increase your website performance . One of the most important part of your website is its database. Like all other files and directories in File Manager, database also consume space on your server. So, it is important to manage it as well.

Today, in this tutorial, we are illustrating the procedure to check the size of website’s database.

Check Size of Website's Database
Check Size of Website’s Database

This can be done with one of the below mentioned ways.

  1. From MySQL Database
  2. From phpMyAdmin
  3. From WordPress Dashboard
  4. From SSH using command

Before proceeding further, it is important for you to know your database name. So, if your database is related to your WordPress website then,

  • Login to cPanel and get inside File Manager section.
  • Get into your WordPress installation directory. On the right side, you will get list of all your WordPress files and directories.
  • Search for wp-config.php file and right click over it and View.
  • Scroll down to the line that says:-
    // ** MySQL settings - You can get this info from your web host ** //
  • After this line, you will get all the information related to your database.

Now, let us learn about all the methods in detail.

#1. From MYSQL Database

The simple and easy way to check the size of website database is from MySQL Database feature in cPanel.

  • Login to your cPanel account and go inside MySQL® Databases.
MySQL Feature in cPanel
MySQL Feature in cPanel
  • On the next page, scroll down to Current Databases section where all your database will be listed.
Database Size from MySQL Database
Database Size from MySQL Database Feature
  • Under the Size option, size of all the database is mentioned. Refer to the above given image.

To get the detailed information about the size of database, consider the other method, i.e, from phpMyAdmin.

#2. From phpMyAdmin

  • From the cPanel feature list page, select phpMyAdmin under Databases section.
phpMyAdmin: Feature in cPanel
phpMyAdmin: Feature in cPanel
  • On the next page, list of all your database will appear on the left panel list. Select the one for which you want to know the detailed information.
  • On the right side, you will find all the tables of the selected database with their size. Refer to the below given image.
Size of Database in phpMyAdmin
Size of Database in phpMyAdmin
  • The total size of all the tables on a page is given at the bottom.

*phpMyAdmin usually limits number of tables on a page, so to get the exact value write the total size given at the bottom of each page and then calculate.

If you are using WordPress website, then you can check the database size from the WordPress admin area as well. Let us go through the procedure in detail.

#3. From WordPress Dashboard

  • Login to WordPress dashboard.
  • On the right side, under Site Health Status click over Site Health Screen.
Site Health Screen
Site Health Screen
  • On the next page, move to Info tab where you will find information related to your WordPress website.
  • Scroll down to Directories and Sizes section and click over the drop down button.
Database Size in WordPress Dashboard
Database Size in WordPress Dashboard
  • Size of the database is given next to Database Size option. Refer to the above given image.

Now, you can check the size of your database via SSH command as well, if you have SSH access.

#4. From SSH command

  • Login to SSH with required credentials.
  • Now, type the following command to switch to mysql prompt.
mysql -u username -p

*Replace username with your account username.

  • It will ask for the password as Enter Password. Type the password and then mysql> prompt will appear.
Login to SSH
Login to SSH
  • To check the size of all the databases, use the following command.
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;

It will take few seconds to give the output depending upon the number of database you have.

  • Now, to check the size of each table in a database, copy and paste the following command.
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;

*Replace the database_name with the database name of your website.

It will give the output including the name and size of all the tables related to particular database.

That’s it !

Hope the article better explains the procedure to check the size of your website’s database. Do share it with your colleagues and drop the query in comment if you have.

Connect with us on social media pages.

Facebook Page:                                                                                       Twitter Page: