Determining MySQL Database Size
When working with MySQL, it's often necessary to ascertain the size of a specific database. One such scenario arises when a database named "v3" needs to be sized.
Query to Retrieve Database Size
The following SQL query can be executed to retrieve the size of the database in megabytes:
SELECT table_schema "DB Name", ROUND(SUM(data_length index_length) / 1024 / 1024, 1) "DB Size in MB" FROM information_schema.tables GROUP BY table_schema;
Understanding the Query
Example Output
For the "v3" database, the query might return an output similar to:
---------- --------------- | DB Name | DB Size in MB | ---------- --------------- | v3 | 28.5 | ---------- ---------------
This indicates that the "v3" database is approximately 28.5 megabytes in size.
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3