Getting MySQL Table Sizes

SELECT table_name table_name,
ROUND(data_length/1024/1024,2) total_size_mb,
FROM information_schema.tables
WHERE table_schema = ‘?????’
ORDER BY 3 desc

Getting MySQL Table Sizes

MySQL-MMM on Centos 5 – Part 1

This guide assumes a clean centos 5 install with no MySQL installed. It will install the MySQL 5.5.6 binaries

Add the DAG and EPEL Repositories

rpm -Uvh

rpm -Uhv

Install MySQL

mkdir install
cd install


tar -xvf MySQL-5.5.6_rc-1.rhel5.x86_64.tar
rpm -i *.rpm

Install required dependencies

yum -y update
yum -y install perl-Proc-Daemon.noarch perl-Text-Diff.noarch perl-MailTools.noarch perl-Log-Log4perl.noarch perl-Log-Dispatch.noarch iproute perl-DBI.x86_64 perl-DBD-MySQL.x86_64 perl-Class-Singleton.noarch gcc perl-Net-ARP.x86_64

yum -y install perl-ExtUtils-CBuilder.noarch perl-Attribute-Handlers-Prospective.noarch perl-Params-Validate.x86_64

yum -y install mysql-mmm-agent mysql-mmm-monitor mysql-mmm-tools

Install and config NTP

Note: The NTP isn’t a requirement of MMM but I normally use virtual machines where the clocks slip. so I have put this more as a reminder to myself to install it

yum -y install ntp
/usr/sbin/ntpdate -u

crontab -l > /root/cron-backup-$$
( cat /root/cron-backup-$$
echo “# Backup the logfiles”
echo “*/30 * * * * /usr/sbin/ntpdate -u > /dev/null” ) | crontab –

MySQL-MMM on Centos 5 – Part 1