Mysql必读MySQL日志分析软件mysqlsla的安装和使用教程
《Mysql必读MySQL日志分析软件mysqlsla的安装和使用教程》要点: 一、下载 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] 二、解压 [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 三、执行perl脚本检查包依赖关系 [root@localhost mysqlsla-2.03]# perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for mysqlsla 四、安装 [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 五、基本使用 mysqlsla -lt slow -sf "+select" -top 10 dowload_server1-slow.log >test_time.log (2).统计慢查询文件为dowload_server1-slow.log的数据库为ultraxsmutf8的所有select和update的慢查询sql,并查询次数最多的100条sql,并写到sql_num.sql中去 mysqlsla -lt slow -sf "+select,update" -top 100 -sort c_sum -db ultraxsmutf8 dowload_server1-slow.log >num_time.log 编程之家PHP培训学院每天发布《Mysql必读MySQL日志分析软件mysqlsla的安装和使用教程》等实战技能,PHP、MYSQL、LINUX、APP、JS,CSS全面培养人才。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |