mysqlsla的安装与使用

来源:未知 责任编辑:责任编辑 发表时间:2014-05-26 11:02 点击:
author:skate
time:2012/02/17

mysqlsla的安装与使用

1.下载 mysqlsla
[root@localhost tmp]# wget http://hackmysql.com/scripts/mysqlsla-2.03.tar.gz
--19:45:45--  http://hackmysql.com/scripts/mysqlsla-2.03.tar.gz
Resolving hackmysql.com... 64.13.232.157
Connecting to hackmysql.com|64.13.232.157|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 33674 (33K) [application/x-tar]
Saving to: `mysqlsla-2.03.tar.gz.2'

100%[===========================================================================================>] 33,674      50.2K/s   in 0.7s   

19:45:47 (50.2 KB/s) - `mysqlsla-2.03.tar.gz.2' saved [33674/33674]

2.解压
[root@localhost tmp]# tar -zxvf mysqlsla-2.03.tar.gz
mysqlsla-2.03/
mysqlsla-2.03/Changes
mysqlsla-2.03/INSTALL
mysqlsla-2.03/README
mysqlsla-2.03/Makefile.PL
mysqlsla-2.03/bin/
mysqlsla-2.03/bin/mysqlsla
mysqlsla-2.03/META.yml
mysqlsla-2.03/lib/
mysqlsla-2.03/lib/mysqlsla.pm
mysqlsla-2.03/MANIFEST
[root@localhost tmp]# cd mysqlsla-2.03
[root@localhost mysqlsla-2.03]# ls
bin  Changes  INSTALL  lib  Makefile.PL  MANIFEST  META.yml  README

3.执行perl脚本检查包依赖关系
[root@localhost mysqlsla-2.03]# perl Makefile.PL 
Checking if your kit is complete...
Looks good
Writing Makefile for mysqlsla

4.安装
[root@localhost mysqlsla-2.03]# make && make install;
cp lib/mysqlsla.pm blib/lib/mysqlsla.pm
cp bin/mysqlsla blib/script/mysqlsla
/usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/mysqlsla
Manifying blib/man3/mysqlsla.3pm
Installing /usr/lib/perl5/site_perl/5.8.8/mysqlsla.pm
Installing /usr/share/man/man3/mysqlsla.3pm
Installing /usr/bin/mysqlsla
Writing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/mysqlsla/.packlist
Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod
[root@localhost mysqlsla-2.03]# 

5.简单使用

语法:
 Slow log: mysqlsla -lt slow slow.log
 General log: mysqlsla -lt general general.log
 Binary log: mysqlbinlog bin.log | mysqlsla -lt binary - 

这里以slow log为例:

[root@localhost mysqlsla-2.03]# mysqlsla -lt slow /tmp/127_slow.log | more
Report for slow logs: /tmp/127_slow.log
24 queries total, 6 unique
Sorted by 't_sum'
Grand Totals: Time 16 s, Lock 1 s, Rows sent 18, Rows Examined 2.10M
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
用户名: 验证码:点击我更换图片
最新评论 更多>>

推荐热点

  • mysql-mmm
  • mysqldump命令——MySQL数据库备份还原
  • Oracle数据导入MySQL的快捷工具:MySQL Migration Toolkit
  • 简简单单储存过程——循环一个select结果集
  • MySQL数据库十大优化技巧
  • Mysql安装笔记
  • Mysql主主复制架构配置
  • Mysql的Procedure 参数为NULL问题分析
  • MySQL Stmt预处理提高效率问题的小研究
网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
Copyright © 2008-2015 计算机技术学习交流网. 版权所有

豫ICP备11007008号-1