Thursday, March 19, 2009

Using Perl Script for memory calculation of NDB Cluster in Fedora 9

Step 1: Check that you have perl

get the perl DBI module installed by using,

yum install perl-DBD-MySQL

step 2: cd into $MYSQL_HOME(or mysql base directory usually /usr/local/mysql and try

./bin/ --database=myDb --user=myUser --socket=/tmp/mysql.sock --password=password

If this fails with the error like Can't use string ("9/16") as a HASH ref while "strict refs" ..... then you need to get fix the bug by replacing the following peice of code,

current code, in release starts from line number 920

foreach my $i(@show_indexes)
$indexes{${%$i}{Key_name}}= {
} if !defined($indexes{${%$i}{Key_name}});

need to be replaced as follows,

foreach my $i(@show_indexes)
$indexes{$i->{Key_name}}= {
} if !defined($indexes{$i->{Key_name}});


then executing,

./bin/ --database=myDb --user=myUser --socket=/tmp/mysql.sock --password=password

should get the output for you.

1 comment:

Anonymous said...

If you are using fedora 11- you might have to
yum install perl-Class-MethodMaker