mysqlreport是一个第三方的状态报告工具, 它把mysql的show status 和 show innodb status的结果进行一系列的后期处理,让可读性更强,更友好。mysqlreport是用perl语言编写,所以想要运行它首先需要安装perl环境;它还要与Mysql数据库连接,所以还需要安装数据库接口 DBI 和 数据库驱动 DBD-Mysql
①下载安装mysqlreport
wget http://hackmysql.com/scripts/mysqlreport-3.5.tgz
tar zxvf mysqlreport-3.5.tgz
cd mysqlreport-3.5
./mysqlreport
报如下错误
Can't locate DBI.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./mysqlreport ine 24.
BEGIN failed–compilation aborted at ./mysqlreport line 24.
②下载安装DBI
wget http://ftp.cuhk.edu.hk/pub/packages/perl/CPAN/authors/id/T/TI/TIMB/DBI-1.616.tar.gz
tar zxvf DBI-1.616.tar.gz
cd DBI-1.616
perl Makefile.PL && make && make test && make && make install
./mysqlreport 再次报错
③安装DBD-mysql
wget http://search.cpan.org/CPAN/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.020.tar.gz
tar zxvf DBD-mysql-4.020.tar.gz
cd DBD-mysql-4.020
perl Makefile.PL -mysql_config=/usr/local/webserver/mysql/bin/mysql_config
make && make test
如果看到如上错误就执行
cp /usr/local/webserver/mysql/lib/mysql/* /usr/lib64/
cd DBD-mysql-4.020
make && make install
④体验mysqlreport
cd DBD-mysql-4.020
./mysqlreport
转载于:https://blog.51cto.com/jinyan2049/928828