Avatar of areyouready344
areyouready344
Flag for United States of America asked on

Having problems installing perl mysql module?

Having problems installing perl mysql module?

I get the following error message when attempting to install

# perl Makefile.PL
Can't exec "mysql_config": No such file or directory at Makefile.PL line 82.

Cannot find the file 'mysql_config'! Your execution PATH doesn't seem
not contain the path to mysql_config. Resorting to guessed values!
Can't exec "mysql_config": No such file or directory at Makefile.PL line 464.
Can't find mysql_config. Use --mysql_config option to specify where mysql_config is located
Can't exec "mysql_config": No such file or directory at Makefile.PL line 464.
Can't find mysql_config. Use --mysql_config option to specify where mysql_config is located
Can't exec "mysql_config": No such file or directory at Makefile.PL line 464.
Can't find mysql_config. Use --mysql_config option to specify where mysql_config is located


Perform search over the internet for this problem and found I needed to install mysql-devel. It install successfully but the same problem continues.

Tried locating the mysql-config file without success..

# find / -name mysql_config
#

Information
========
centOS 6
# rpm -ql mysql-devel-5.1.52-1.el6_0.1.i686
/usr/include/mysql
/usr/include/mysql/decimal.h
/usr/include/mysql/errmsg.h
/usr/include/mysql/keycache.h
/usr/include/mysql/m_ctype.h
/usr/include/mysql/m_string.h
/usr/include/mysql/my_alloc.h
/usr/include/mysql/my_attribute.h
/usr/include/mysql/my_compiler.h
/usr/include/mysql/my_config.h
/usr/include/mysql/my_config_i386.h
/usr/include/mysql/my_dbug.h
/usr/include/mysql/my_dir.h
/usr/include/mysql/my_getopt.h
/usr/include/mysql/my_global.h
/usr/include/mysql/my_list.h
/usr/include/mysql/my_net.h
/usr/include/mysql/my_no_pthread.h
/usr/include/mysql/my_pthread.h
/usr/include/mysql/my_sys.h
/usr/include/mysql/my_xml.h
/usr/include/mysql/mysql.h
/usr/include/mysql/mysql_com.h
/usr/include/mysql/mysql_embed.h
/usr/include/mysql/mysql_time.h
/usr/include/mysql/mysql_version.h
/usr/include/mysql/mysqld_ername.h
/usr/include/mysql/mysqld_error.h
/usr/include/mysql/plugin.h
/usr/include/mysql/sql_common.h
/usr/include/mysql/sql_state.h
/usr/include/mysql/sslopt-case.h
/usr/include/mysql/sslopt-longopts.h
/usr/include/mysql/sslopt-vars.h
/usr/include/mysql/typelib.h
/usr/lib/mysql/libmysqlclient.so
/usr/lib/mysql/libmysqlclient_r.so
/usr/share/aclocal/mysql.m4

mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 94
Server version: 5.5.14 MySQL Community Server (GPL)
Perl

Avatar of undefined
Last Comment
areyouready344

8/22/2022 - Mon
burnsj2

do you have the mysql shared libraries installed? (MySQL-shared-compat-5.5.15)
areyouready344

ASKER
thanks burnsj2, let me check
areyouready344

ASKER
Yes, I have it installed...

# rpm -qa | grep [Mn]y
ibus-pinyin-1.3.8-1.el6.i686
MySQL-client-5.5.14-1.linux2.6.i386
MySQL-shared-5.5.14-1.linux2.6.i386
MySQL-shared-compat-5.5.14-1.linux2.6.i386
MySQL-server-5.5.14-1.linux2.6.i386
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
burnsj2

It looks like mysql_config is a utility distributed with MySQL-Devel RPM package.
MySQL-devel-5.5.14-1.linux2.6.i386.rpm

http://forums.mysql.com/read.php?51,54411,68942#msg-68942
areyouready344

ASKER
thanks burnsj2, making good progress. The MySQL-devel-5.5.14-1.linux2.6.i386.rpm package installed successfully. And was able to locate the mysql_config file.

# find / -name mysql_config
/usr/bin/mysql_config


Now I get the following message

Can't locate MySql.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_p.


Any idea how to resolve this one?
burnsj2

Check it these libraries are installed:

libmysql-dbd-perl
libclass-dbi-mysql-perl
libclass-dbi-perl
libdbi-perl

Is Mysql.pm anywhere on your system? Maybe it needs to be added to the include path?

Also what happens if you do yum install perl-DBI

Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
areyouready344

ASKER
Will check the libraries but in the mean time, here's the results of running yum install perl-DBI

# yum perl-DBI
Loaded plugins: fastestmirror, refresh-packagekit
No such command: perl-DBI. Please use /usr/bin/yum --help
[root@edith perl]# yum install perl-DBI
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
 * base: mirrors.usc.edu
 * extras: centos.mirrors.hoobly.com
 * updates: centos-distro.cavecreek.net
base                                                                                                                             | 3.7 kB     00:00    
extras                                                                                                                           |  951 B     00:00    
updates                                                                                                                          | 3.5 kB     00:00    
Setting up Install Process
Package perl-DBI-1.609-4.el6.i686 already installed and latest version
Nothing to do
[root@edith perl]# yum install perl-DBI
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
 * base: centos-distro.cavecreek.net
 * extras: mirror.rocketinternet.net
 * updates: centos-distro.cavecreek.net
Setting up Install Process
Package perl-DBI-1.609-4.el6.i686 already installed and latest version
Nothing to do
areyouready344

ASKER
# find / -name Mqsql.pm
# find / -name libmysql-dbd-perl
# find / -name libclass-dbi-mysql-perl
# find / -name libclass-dbi-perl
# find / -name libdbi-perl
#
burnsj2

Maybe its already installed if yum shows perl-DBI installed.  Is there a reason you need to compile it?

In my perl scripts I just declare: use DBI; and all set to go.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
burnsj2

Also try yum install perl-DBD-MySQL
areyouready344

ASKER
Header content of readFile.pl
     
      1 #!/usr/bin/perl
      2
      3 use strict;
      4 use warnings;
      5 use 5.010;
      6 use DBI;
      7 use DBD::Mysql;
      8 use Date::Manip;
      9 use Date::Manip::Date;


No I'm not compiling it. I"m just running it from the command, like this:

# perl readFile.pl
Can't locate DBD/Mysql.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /.
BEGIN failed--compilation aborted at readFile.pl line 7.
ASKER CERTIFIED SOLUTION
burnsj2

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
areyouready344

ASKER
i successfully installed perl-DBD-MySQL
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
burnsj2

Did that fix the error message?
areyouready344

ASKER
After I successfully installed the perl-DBD-MySQL, I went to sleep. I'm now trying to test it..
areyouready344

ASKER
It still says it can't find the MySql.pm file

Can't locate DBD/Mysql.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/.
BEGIN failed--compilation aborted at readFile.pl line 7.

I searched for this file and can't locate it.

# find / -name MySql.pm
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
areyouready344

ASKER
thanks a million burnsj2, it working now. I just remembered you told me to try all lower case letters. That fixed it and perform a search using lower and upper cases. And use ---

use DBD::mysql

#find / -name [Mm][Yy][Ss][Qq][Ll].pm