Home > Database > Mysql Tutorial > body text

How to view the size of all MySQL databases?

WBOY
Release: 2023-09-17 12:17:09
forward
720 people have browsed it

How to view the size of all MySQL databases?

We can check the size of all MySQL databases with the help of the following statement

mysql> SELECT table_schema "Database",
-> SUM(data_length + index_length)/1024/1024 "Size in MB"
-> FROM information_schema.TABLES GROUP BY table_schema;

+--------------------+----------------+
| Database           | Size in MB     |
+--------------------+----------------+
| gaurav             | 1.04785156     |
| information_schema | 0.00878906     |
| mysql              | 0.68551350     |
| performance_schema | 0.00000000     |
| sample             | 0.04687500     |
| tutorial           | 0.03125000     |
+--------------------+----------------+

6 rows in set, 1 warning (0.33 sec)
Copy after login

The above is the detailed content of How to view the size of all MySQL databases?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!