Code: Select all
[root@NagiosServer mysql]# du -h
1012K ./mysql
0 ./test
212K ./performance_schema
6.5G ./nagios
7.0M ./nagiosql
14G ./nagiosxi
21G .
Code: Select all
[root@NagiosServer mysql]# du -h
1012K ./mysql
0 ./test
212K ./performance_schema
6.5G ./nagios
7.0M ./nagiosql
14G ./nagiosxi
21G .
Code: Select all
select
round(((data_length + index_length) / 1024 / 1024), 2) "size_in_mb",
concat(table_schema, '.', table_name) as "table"
from information_schema.tables
where data_length is not null
order by data_length + index_length;
Code: Select all
select count(*) from nagios_logentries where entry_time < date_sub(now(), interval 90 day);
-- only do this if you're sure: delete from nagios_logentries where entry_time < date_sub(now(), interval 90 day);
Code: Select all
mysql -undoutils -pn@gweb nagios -e 'select count(*) from nagios_logentries where entry_time < date_sub(now(), interval 90 day);'
# only do this if you're sure: mysql -undoutils -pn@gweb nagios -e 'delete from nagios_logentries where entry_time < date_sub(now(), interval 90 day);'