2024年4月11日发(作者:)
Mysql管理必备工具Maatkit详解
Maatkit是一个Perl写的Mysql开源管理工具,根据调查全球大约有70%多的Mysql管理员
使用这个工具来管理Mysql,但我发现在国内很少有人知道这个工具,因此打算写一个系列
的文章来介绍这个工具,并带上自己的心得和一些体会。
首先安装Maatkt,需要Perl,DBI,DBD::mysql相关模块。
perl -v
This is perl, v5.8.5 built for i386-linux-thread-multi
Copyright 1987-2004, Larry Wall
一般linux安装的时候默认安装了perl。
可以到这里下载
Mysql的安装网上到处都是,就省略了。
,可以到这里下载相应的版本
tar zxf
cd DBI-1.58
perl
make
make test
make
make install
-showtable包,可以到这里下载查找相应的包
gzip -c -d Data-ShowTable-?.??. | tar xvf -
cd Data-ShowTable-?.??
perl
make
不要试make test,测试套件损坏了!
make install
-mysql-modules 可以到这里下载
gzip -c -d Msql-Mysql-modules-?.??. | tar xvf -
将压缩文件接压缩到一个名为Msql-Mysql-modules-?.??的目录。
cd Msql-Mysql-modules-?.??
perl
在 "perl " 期间,会向你提出一些问题。特别是你必须选择安装驱动器(MySQL,
mSQL2 and/or mSQL1)。MySQL驱动程序叫
DBD::mysql,单独的mSQL驱动程序叫DBD::mSQL。如果你想支持mSQL1和mSQL2,用
DBD::mSQL1。
make
make test
make install
-mysql 可以到这里下载
安装DBD: DBD-mysql-4.005
perl --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/' for
module DBD::mysql: .12: cannot open shared object file: No such file or directory
at
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/ 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 --mysql_config=/usr/local/mysql/bin/mysql_config
make
make test
make install
7.安装maatkit 可以到这里下载
tar zxvf
cd maatkit-2325
perl
make install
下面分别列出这套工具,以及官方的定义,在后续的文章中,会分别对这些工具进行介绍,
以及自己的测试和心得体会。
mk-archiver Archive rows from a MySQL table into another table or a file.
mk-audit Analyze, summarize and report on MySQL config, schema and operation
mk-checksum-filter Filter checksums from mk-table-checksum.
mk-deadlock-loggerExtract and log MySQL deadlock information.
mk-duplicate-key-checkerFind duplicate keys and foreign keys on MySQL tables.
mk-fifo-split Split files and pipe lines to a fifo without really splitting.
mk-find Find MySQL tables and execute actions, like GNU find.
mk-heartbeat Monitor MySQL replication delay.
mk-log-player Split and play MySQL slow logs.
mk-log-server Serve MySQL binary logs.
mk-parallel-dump Dump sets of MySQL tables in parallel.
mk-parallel-restore Load files into MySQL in parallel.
发布评论