Having problems installing perl mysql module?

areyouready344
areyouready344 used Ask the Experts™
on
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)
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

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

Author

Commented:
thanks burnsj2, let me check

Author

Commented:
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
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

Commented:
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

Author

Commented:
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?

Commented:
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

Author

Commented:
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

Author

Commented:
# find / -name Mqsql.pm
# find / -name libmysql-dbd-perl
# find / -name libclass-dbi-mysql-perl
# find / -name libclass-dbi-perl
# find / -name libdbi-perl
#

Commented:
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.

Commented:
Also try yum install perl-DBD-MySQL

Author

Commented:
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.
Commented:
Found this:

Can't locate DBD/mysql.pm

An error similar to this indicates:

the required DBD module has not been installed (yum install perl-DBD-MySQL),
the module is not on the include path (see above, but unlikely if the DBI module was loaded), or
the name of the data source passed to DBI::connect was incorrect.
You can check the last point by inspecting the first line of the error message, where it gives the path to the module that could not be loaded. For connecting to MySQL it should be DBD/mysql.pm (all lower case for ‘mysql’).

Author

Commented:
i successfully installed perl-DBD-MySQL

Commented:
Did that fix the error message?

Author

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

Author

Commented:
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

Author

Commented:
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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial