1 databaseº° ¿ë·® È®ÀÎ
1.1 Äõ¸® ¡Ú
mysql> SELECT table_schema "Database", ROUND(SUM(data_length+index_length)/1024/1024,1) "MB" FROM information_schema.TABLES GROUP BY 1;
+--------------------+--------+
| Database | MB |
+--------------------+--------+
| hello | 1086.7 |
| information_schema | 0.0 |
| jmnote | 217.3 |
| mysql | 0.5 |
+--------------------+--------+
4 rows in set (0.01 sec)
1.2 du
[root@zetawiki ~]# du -h /var/lib/mysql
1.1G /var/lib/mysql/hello
779M /var/lib/mysql/ibdata1
5.1M /var/lib/mysql/ib_logfile0
5.1M /var/lib/mysql/ib_logfile1
36M /var/lib/mysql/jmnote
812K /var/lib/mysql/mysql
0 /var/lib/mysql/mysql.sock
2.2G /var/lib/mysql
2 Àüü ¿ë·® È®ÀÎ
2.1 Äõ¸®
mysql> SELECT SUM(data_length+index_length)/1024/1024 used_MB, SUM(data_free)/1024/1024 free_MB FROM information_schema.tables;
+---------------+---------------+
| used_MB | free_MB |
+---------------+---------------+
| 2775.87963295 | 5230.69857121 |
+---------------+---------------+
1 row in set (1.04 sec)
2.2 du
[root@zetawiki ~]# du -sh /var/lib/mysql
2.2G /var/lib/mysql