DBA Hub

📋Steps in this guide1/1

Find database sizes in mysql

How to get MySQL / MariaDB db size:

mysql configurationintermediate
by MYSQL
14 views
1

Find database sizes in mysql

How to get MySQL / MariaDB db size:

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
MariaDB [(none)]>
SELECT table_schema AS "Database", SUM(data_length + index_length) / 1024 / 1024 / 1024 AS "Size (GB)" FROM information_schema.TABLES GROUP BY table_schema;
+--------------------+----------------+
| Database           | Size (GB) |
+--------------------+----------------+
| information_schema | 0.000198364258 |
| mysql              | 0.002159118652 |
| performance_schema | 0.000000000000 |
| va                 | 0.000030517578 |
| vasu               | 0.000061035156 |
+--------------------+----------------+
5 rows in set (1.564 sec)
MariaDB [(none)]>
SELECT table_schema AS "Database", SUM(data_length + index_length) / 1024 / 1024 AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema;
+--------------------+------------+
| Database           | Size (MB) |
+--------------------+------------+
| information_schema | 0.20312500 |
| mysql              | 2.21093750 |
| performance_schema | 0.00000000 |
| va                 | 0.03125000 |
| vasu               | 0.06250000 |
+--------------------+------------+
5 rows in set (0.345 sec)

Comments (0)

Please to add comments

No comments yet. Be the first to comment!