How to Check MySQL Database Size

  1. To check the size of the database using the command line:
    You can log in to the MySQL database server’s command line interface and execute the following SQL statement to view the database size.
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;
  1. To view the size of a database using MySQL Workbench, you can utilize this graphical tool. Simply select the desired database in MySQL Workbench, then navigate to “Schema Inspector” in the left sidebar to view the size information of the database in the panel on the right.
  2. You can check the size of the database using phpMyAdmin by logging in, selecting the database you want to view, and then clicking on the “Operations” tab. At the bottom of the page, you can see the size information of that particular database.

Here are three common methods to view the size of MySQL databases, you can choose the method that suits you to check the database size.

bannerAds