1.perl安装
[root@oracle mysqlreport-3.4a]# perl -v
this is perl, v5.8.5 built for i386-linux-thread-multi
copyright 1987-2004, larry wall
perl may be copied only under the terms of either the artistic license or the
gnu general public license, which may be found in the perl 5 source kit.
complete documentation for perl, including faq lists, should be found on
this system using `man perl' or `perldoc perl'. if you have access to the
internet, point your browser at , the perl home page.
一般linux安装的时候默认安装了perl。
2.mysql安装
省略。网上有很多类型的介绍。
3.dbi安装
到下载相应的版本
#tar zxf dbi-1.58.tar.gz
#cd dbi-1.58
#perl makefile.pl
#make
#make test
#make
#make install
4.data-showtable包
到查找相应的包
gzip -c -d data-showtable-?..tar.gz | tar xvf -
cd data-showtable-?.
perl makefile.pl
make
不要试make test,,测试套件损坏了!
make install
5.msql-mysql-modules
gzip -c -d msql-mysql-modules-?..tar.gz | tar xvf -
将压缩文件接压缩到一个名为msql-mysql-modules-?.的目录。
cd msql-mysql-modules-?.
perl makefile.pl
在 perl makefile.pl 期间,会向你提出一些问题。特别是你必须选择安装驱动器(mysql, msql2 and/or msql1)。mysql驱动程序叫
dbd::mysql,单独的msql驱动程序叫dbd::msql。如果你想支持msql1和msql2,用dbd::msql1。
make
make test
make install
现在你可以使用dbi编程mysql了!
6.dbd-mysql
安装dbd: dbd-mysql-4.005
#perl makefile.pl --mysql_config=/usr/local/mysql/bin/mysql_config
#make
#make test
#make
#make install
如果出现以下错误,
install_driver(mysql) failed: can't load '/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/dbd/mysql/mysql.so' for
module dbd::mysql: libmysqlclient.so.12: cannot open shared object file: no such file or directory at
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/dynaloader.pm line 230.
at (eval 6) line 3
compilation failed in require at (eval 6) line 3.
perhaps a required shared library or dll isn't installed where expected
at /root/mysqlreport line 162
就做操作
#cp /usr/local/mysql/include/mysql* /usr/include/
#cp /usr/local/mysql/lib/* /usr/lib/ (64位的是lib64)
然后再重新安装dbd: dbd-mysql-4.005
#perl makefile.pl --mysql_config=/usr/local/mysql/bin/mysql_config
#make
#make test
#make install
7.mysqlreport 安装
cd /usr/local/sbin
wget hackmysql.com/scripts/mysqlreport
chmod 755 mysqlreport
cd /
[root@oracle mysqlreport-3.4a]# ./mysqlreport --help
mysqlreport v3.4a jan 23 2008
mysqlreport makes an easy-to-read report of important mysql status values.
command line options (abbreviations work):
--user user connect to mysql as user
--password pass use pass or prompt for mysql user's password
--host address connect to mysql at address
--port port connect to mysql at port
--socket socket connect to mysql at socket
--no-mycnf don't read ~/.my.cnf
--infile file read status values from file instead of mysql
--outfile file write report to file
--email address email report to address (doesn't work on windows)
--flush-status issue flush status; after getting current values
--relative x generate relative reports. if x is an integer,
reports are live from the mysql server x seconds apart.
if x is a list of infiles (file1 file2 etc.),
reports are generated from the infiles in the order
that they are given.
--report-count n collect n number of live relative reports (default 1)
--detach fork and detach from terminal (run in background)
--help prints this
--debug print debugging information
