--查看MYSQL磁盘使用率。
--查看每个数据库的大小。
[root@mysql1 mysql]# mysqldiskusage --server=root:rootroot@192.168.1.51:3306
WARNING: Using a password on the command line interface can be insecure.
# Source on 192.168.1.51: ... connected.
# Database totals:
+---------------------+-------------+
| db_name | total |
+---------------------+-------------+
| mysql | 12,090,404 |
| performance_schema | 822,167 |
| sys | 480,322 |
| test | 107,009 |
+---------------------+-------------+
Total database disk usage = 13,499,902 bytes or 12.87 MB
#...done.
--查看数据库和日志的大小。
1.数据库,
2.错误日志
3.binlog
4.重做日志文件
5.共享表空间大小
[root@mysql1 mysql]# mysqldiskusage --server=root:rootroot@192.168.1.51:3306 --format=g -a -vvv
WARNING: Using a password on the command line interface can be insecure.
# Source on 192.168.1.51: ... connected.
# Database totals:
+---------------------+--------------+------------+-------------+-------------+
| db_name | db_dir_size | data_size | misc_files | total |
+---------------------+--------------+------------+-------------+-------------+
| mysql | 12,090,404 | 2,560,843 | 271,123 | 12,090,404 |
| performance_schema | 822,167 | 0 | 822,167 | 822,167 |
| sys | 480,322 | 16,384 | 382,018 | 480,322 |
| test | 107,009 | 16,384 | 8,705 | 107,009 |
+---------------------+--------------+------------+-------------+-------------+
Total database disk usage = 13,499,902 bytes or 12.87 MB
# Log information.
# The general_log is turned off on the server.
# The slow_query_log is turned off on the server.
+----------------+----------+
| log_name | size |
+----------------+----------+
| mysql3306.log | 651,360 |
+----------------+----------+
Total size of logs = 651,360 bytes or 636.09 KB
# Binary log information:
Current binary log file = mysql-binlog.000086
+----------------------+--------+
| log_file | size |
+----------------------+--------+
| mysql-binlog.000074 | 244 |
| mysql-binlog.000075 | 244 |
| mysql-binlog.000076 | 244 |
| mysql-binlog.000077 | 217 |
| mysql-binlog.000078 | 11132 |
| mysql-binlog.000079 | 244 |
| mysql-binlog.000080 | 244 |
| mysql-binlog.000081 | 244 |
| mysql-binlog.000082 | 905 |
| mysql-binlog.000083 | 244 |
| mysql-binlog.000084 | 537 |
| mysql-binlog.000085 | 217 |
| mysql-binlog.000086 | 194 |
| mysql-binlog.index | 507 |
+----------------------+--------+
Total size of binary logs = 15,417 bytes or 15.06 KB
# Server is not an active slave - no relay log information.
# InnoDB tablespace information:
+--------------+-------------+--------------------+-------------------------+
| innodb_file | size | type | specificaton |
+--------------+-------------+--------------------+-------------------------+
| ib_logfile0 | 50,331,648 | log file | |
| ib_logfile1 | 50,331,648 | log file | |
| ibdata1 | 79,691,776 | shared tablespace | ibdata1:12M:autoextend |
+--------------+-------------+--------------------+-------------------------+
Total size of InnoDB files = 180,355,072 bytes or 172.00 MB
#...done.
总结:
可以看到这个工具巡检还是非常方便的。