This article demonstrates how to check the size of MySQL databases and tables. You can do this by using the phpMyAdmin web interface or by using the command-line mysql program.
You can use the phpMyAdmin web interface to check the sizes of MySQL databases and tables. To do this, follow these steps:
The phpMyAdmin administration page appears in a new window.
In the right pane, locate the Size column. phpMyAdmin lists the size of each table in the database:
To obtain the total size of the database, scroll down to the end of the Size column:
You can use the mysql command-line program to check the sizes of MySQL databases and tables. To do this, follow these steps:
mysql -u username -p
To check the sizes of all of your databases, at the mysql> prompt type 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;
To check the sizes of all of the tables in a specific database, at the mysql> prompt, type the following command. Replace database_name with the name of the database that you want to check:
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;
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.