1

I am trying to tune the MySQL tuner script written in Perl. But getting the error below:

root@server2 [/tmp]# perl mysqltuner.pl
Can't locate Text/Template.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at mysqltuner.pl line 2816.
BEGIN failed--compilation aborted at mysqltuner.pl line 2816 (#1)
    (F) You said to do (or require, or use) a file that couldn't be
    found. Perl looks for the file in all the locations mentioned in @INC,
    unless the file name included the full path to the file.  Perhaps you
    need to set the PERL5LIB or PERL5OPT environment variable to say where
    the extra library is, or maybe the script needs to add the library name
    to @INC.  Or maybe you just misspelled the name of the file.  See
    perlfunc/require and lib.

Uncaught exception from user code:
        Can't locate Text/Template.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at mysqltuner.pl line 2816.
BEGIN failed--compilation aborted at mysqltuner.pl line 2816.
 at mysqltuner.pl line 2816

It would glad to provide solution for the same.

serenesat
  • 4,611
  • 10
  • 37
  • 53
rishi dadwal
  • 41
  • 1
  • 2
  • 2
    Your script is trying to import a module `Text::Template`, but cannot find it. That's not a core module, so you may need to install it. – rutter Nov 20 '15 at 07:59
  • i have alrady installed the text::Template module /usr/local/cpanel/Cpanel/Template.pm /usr/local/cpanel/Cpanel/Exception/Template.pm /usr/local/cpanel/Cpanel/Exim/Config/Template.pm /usr/local/cpanel/Cpanel/ZoneFile/Template.pm /usr/local/cpanel/Whostmgr/Template.pm /usr/local/lib/perl5/site_perl/5.8.8/HTML/Template.pm /usr/local/lib/perl5/site_perl/5.8.8/Net/OSCAR/XML/Template.pm /usr/local/lib/perl5/site_perl/5.8.8/x86_64-linux/Template.pm /usr/local/lib64/perl5/Template.pm /usr/local/share/perl5/Net/OSCAR/XML/Template.pm /usr/share/perl5/vendor_perl/HTML/Template.pm – rishi dadwal Nov 20 '15 at 12:22
  • @rishidadwal I don't see `Text/Template.pm` in there. *How* did you install it? – Biffen Nov 20 '15 at 14:22

2 Answers2

1

In your perl script mysqltuner.pl, you are using a module Text::Template which is not installed in your system, that's why you are getting this warning.
You can installed it by using cpan. If you are on Linux system, open a terminal and type:

sudo cpan install Text::Template #sudo is not required if you have login as root.

If you are on windows system and using ActivePerl, use this:

ppm install Text-Template
serenesat
  • 4,611
  • 10
  • 37
  • 53
  • Hi thanks for the reply /usr/local/cpanel/Cpanel/Template.pm /usr/local/cpanel/Cpanel/Exception/Template.pm /usr/local/cpanel/Cpanel/Exim/Config/Template.pm /usr/local/cpanel/Cpanel/ZoneFile/Template.pm /usr/local/cpanel/Whostmgr/Template.pm /usr/local/lib/perl5/site_perl/5.8.8/HTML/Template.pm /usr/local/lib/perl5/site_perl/5.8.8/Net/OSCAR/XML/Template.pm /usr/local/lib/perl5/site_perl/5.8.8/x86_64-linux/Template.pm /usr/local/lib64/perl5/Template.pm /usr/local/share/perl5/Net/OSCAR/XML/Template.pm /usr/share/perl5/vendor_perl/HTML/Template.pm – rishi dadwal Nov 20 '15 at 12:21
0

Open Command Promt. Type in the following:

ppm install Text-Template

AmitSK
  • 11
  • 3
  • 2
    ppm is the package manager for ActivePerl on Windows. The OP seems to work on a linux system. – dgw Nov 20 '15 at 08:29