Can't locate DBI.pm in @INC (@INC contains: /usr/lib/perl错误解决方法

在安装使用mysqlsla时遇到了这个常见的错误,错误大致描述如下:

[root@vpn mysqlsla-2.03]# mysqlsla -lt slow /opt/slow.log | more
Can't locate DBI.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/bin/mysqlsla line 2098.
BEGIN failed--compilation aborted at /usr/bin/mysqlsla line 2098.



错误原因很简单缺少DBI,安装即可:

[root@vpn mysqlsla-2.03]# wget http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI-1.623.tar.gz
[root@vpn mysqlsla-2.03]# tar -zxvf DBI-1.623.tar.gz
[root@vpn mysqlsla-2.03]# cd DBI-1.623
[root@vpn mysqlsla-2.03]# perl Makefile.PL
[root@vpn mysqlsla-2.03]# make && make install



安装完成DBI后再测试OK了:

[root@vpn mysqlsla-2.03]# mysqlsla -lt slow /opt/slow.log | more
mysqlsla -lt slow /opt/slow.log  | more                
Use of uninitialized value $line in pattern match (m//) at /usr/local/bin/mysqlsla line 675, <LOG> line 211.
Use of uninitialized value $line in pattern match (m//) at /usr/local/bin/mysqlsla line 692, <LOG> line 211.
Report for slow logs: /opt/slow.log
35 queries total, 15 unique
Sorted by 't_sum'
Grand Totals: Time 229 s, Lock 0 s, Rows sent 443.57k, Rows Examined 10.11M


______________________________________________________________________ 001 ___
Count         : 7  (20.00%)
Time          : 42.930986 s total, 6.132998 s avg, 4.046063 s to 10.72709 s max  (18.76%)
Lock Time (s) : 354 otal, 51 vg, 38 o 65 ax  (15.26%)
Rows sent     : 54 avg, 54 to 54 max  (0.09%)
Rows examined : 1.58k avg, 222 to 4.57k max  (0.11%)
Database      : discuz_nanchang
Users         :
       discuz_nanchang@ 192.168.1.10 : 42.86% (3) of query, 11.43% (4) of all users
       discuz_nanchang@ 192.168.1.15 : 42.86% (3) of query, 8.57% (3) of all users
       discuz_nanchang@ 192.168.1.20 : 14.29% (1) of query, 2.86% (1) of all users

Query abstract:
SET timestamp=N; SELECT t.* FROM pre_forum_thread t WHERE t.fid='S' AND (t.displayorder IN (N2)) ORDER BY displayorder DESC, lastpost DESC LIMIT N;

Query sample:
SET timestamp=1354213966;
SELECT t.* FROM pre_forum_thread t
                        WHERE  t.fid='139'  AND (t.displayorder IN (0, 1))
                        ORDER BY displayorder DESC, lastpost DESC
                        LIMIT 54;
……………………
……………………


本文最后更新于 2013-01-29 21:58:37 并被添加「linux mysqlsla linux基础」标签,已有 11849 位童鞋阅读过。
本文作者:未来往事
本站使用「署名 4.0 国际」创作共享协议,可自由转载、引用,但需署名作者且注明文章出处

相关文章

此处评论已关闭