CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: DBI:
Unable to install DBD:mysql

 



thala
New User

Jun 30, 2011, 7:46 AM

Post #1 of 3 (17032 views)
Unable to install DBD:mysql Can't Post

cpan> install DBD::mysql
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
Database was generated on Thu, 30 Jun 2011 07:41:56 GMT
DBD::mysql is up to date.

-------------------------------------------
when I run a script I'm getting an error

install_driver(mysql) failed: Can't load '/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.15: cannot open shared object file: No such file or directory at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230.
at (eval 16) line 3
Compilation failed in require at (eval 16) line 3.
Perhaps a required shared library or dll isn't installed where expected
at zip.pl line 235
-------------------------------------------

cpan> i /DBD-mysql/
Distribution C/CA/CAPTTOFU/DBD-mysql-3.0008.tar.gz
Distribution C/CA/CAPTTOFU/DBD-mysql-4.019.tar.gz
Distribution G/GR/GRISHACE/DBD-mysql-AutoTypes-1.0.tar.gz
Distribution L/LI/LINNIN/DBD-mysql-SimpleMySQL-0.5.tar.gz
Distribution O/OY/OYAMA/DBD-mysqlPP-0.04.tar.gz
5 items found

cpan> install C/CA/CAPTTOFU/DBD-mysql-4.019.tar.gz
Running make for C/CA/CAPTTOFU/DBD-mysql-4.019.tar.gz
CPAN: Digest::MD5 loaded ok
CPAN: Compress::Zlib loaded ok
Checksum for /root/.cpan/sources/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.019.tar.gz ok
Scanning cache /root/.cpan/build for sizes
Deleting from cache: /root/.cpan/build/XML-SAX-Expat-0.40 (11.6>10.0 MB)
Deleting from cache: /root/.cpan/build/XML-Simple-2.18 (11.4>10.0 MB)
Deleting from cache: /root/.cpan/build/install-0.01 (10.9>10.0 MB)
Deleting from cache: /root/.cpan/build/Storable-2.25 (10.8>10.0 MB)
DBD-mysql-4.019/
DBD-mysql-4.019/MANIFEST
DBD-mysql-4.019/ChangeLog
DBD-mysql-4.019/TODO
DBD-mysql-4.019/Makefile.PL
DBD-mysql-4.019/myld
DBD-mysql-4.019/eg/
DBD-mysql-4.019/eg/proc_example2.pl
DBD-mysql-4.019/eg/prepare_memory_usage.pl
DBD-mysql-4.019/eg/proc_example3.pl
DBD-mysql-4.019/eg/proc_example1.pl
DBD-mysql-4.019/eg/proc_example2b.pl
DBD-mysql-4.019/eg/bug21028.pl
DBD-mysql-4.019/eg/bug14979.pl
DBD-mysql-4.019/eg/issue21946.pl
DBD-mysql-4.019/eg/bug30033.pl
DBD-mysql-4.019/eg/decimal_test.pl
DBD-mysql-4.019/eg/proc_example4.pl
DBD-mysql-4.019/eg/proc_example2a.pl
DBD-mysql-4.019/eg/bug30033pg.pl
DBD-mysql-4.019/INSTALL.html
DBD-mysql-4.019/META.yml
DBD-mysql-4.019/mysql.xs
DBD-mysql-4.019/dbdimp.h
DBD-mysql-4.019/Makefile.PL.embedded
DBD-mysql-4.019/MANIFEST.SKIP
DBD-mysql-4.019/dbdimp.c
DBD-mysql-4.019/constants.h
DBD-mysql-4.019/lib/
DBD-mysql-4.019/lib/DBD/
DBD-mysql-4.019/lib/DBD/mysql.pm
DBD-mysql-4.019/lib/DBD/mysql/
DBD-mysql-4.019/lib/DBD/mysql/INSTALL.pod
DBD-mysql-4.019/lib/DBD/mysql/GetInfo.pm
DBD-mysql-4.019/lib/Bundle/
DBD-mysql-4.019/lib/Bundle/DBD/
DBD-mysql-4.019/lib/Bundle/DBD/mysql.pm
DBD-mysql-4.019/t/
DBD-mysql-4.019/t/41blobs_prepare.t
DBD-mysql-4.019/t/71impdata.t
DBD-mysql-4.019/t/42bindparam.t
DBD-mysql-4.019/t/80procs.t
DBD-mysql-4.019/t/51bind_type_guessing.t
DBD-mysql-4.019/t/40server_prepare.t
DBD-mysql-4.019/t/50commit.t
DBD-mysql-4.019/t/76multi_statement.t
DBD-mysql-4.019/t/30insertfetch.t
DBD-mysql-4.019/t/70takeimp.t
DBD-mysql-4.019/t/40nulls.t
DBD-mysql-4.019/t/60leaks.t
DBD-mysql-4.019/t/40listfields.t
DBD-mysql-4.019/t/86_bug_36972.t
DBD-mysql-4.019/t/29warnings.t
DBD-mysql-4.019/t/41bindparam.t
DBD-mysql-4.019/t/40server_prepare_error.t
DBD-mysql-4.019/t/32insert_error.t
DBD-mysql-4.019/t/40keyinfo.t
DBD-mysql-4.019/t/75supported_sql.t
DBD-mysql-4.019/t/35prepare.t
DBD-mysql-4.019/t/35limit.t
DBD-mysql-4.019/t/mysql.dbtest
DBD-mysql-4.019/t/40types.t
DBD-mysql-4.019/t/25lockunlock.t
DBD-mysql-4.019/t/40nulls_prepare.t
DBD-mysql-4.019/t/mysql.mtest
DBD-mysql-4.019/t/55utf8.t
DBD-mysql-4.019/t/85init_command.t
DBD-mysql-4.019/t/00base.t
DBD-mysql-4.019/t/40bindparam.t
DBD-mysql-4.019/t/lib.pl
DBD-mysql-4.019/t/52comment.t
DBD-mysql-4.019/t/50chopblanks.t
DBD-mysql-4.019/t/10connect.t
DBD-mysql-4.019/t/53comment.t
DBD-mysql-4.019/t/31insertid.t
DBD-mysql-4.019/t/20createdrop.t
DBD-mysql-4.019/t/65types.t
DBD-mysql-4.019/t/40bindparam2.t
DBD-mysql-4.019/t/mem_leak.pl
DBD-mysql-4.019/t/40numrows.t
DBD-mysql-4.019/t/40catalog.t
DBD-mysql-4.019/t/40blobs.t
DBD-mysql-4.019/README
Removing previously used /root/.cpan/build/DBD-mysql-4.019

CPAN.pm: Going to build C/CA/CAPTTOFU/DBD-mysql-4.019.tar.gz

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


PLEASE NOTE:

For 'make test' to run properly, you must ensure that the
database user 'root' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.

mysql> grant all privileges on test.* to 'root'@'localhost' identified by 's3kr1t';

You can also optionally set the user to run 'make test' with:

perl Makefile.PL --testuser=username

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
Failed to determine directory of mysql.h. Use

perl Makefile.PL --cflags=-I<dir>

to set this directory. For details see the INSTALL.html file,
section "C Compiler flags" or type

perl Makefile.PL --help
Running make test
Make had some problems, maybe interrupted? Won't test
Running make install
Make had some problems, maybe interrupted? Won't install

cpan>
--------------------------------------------------

Then I tried installing DBD::mysql manually by downloading

DBD-mysql-4.019.tar.gz


[root@lintest11 DBD-mysql-4.019]# 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


PLEASE NOTE:

For 'make test' to run properly, you must ensure that the
database user 'root' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.

mysql> grant all privileges on test.* to 'root'@'localhost' identified by 's3kr1t';

You can also optionally set the user to run 'make test' with:

perl Makefile.PL --testuser=username

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
Failed to determine directory of mysql.h. Use

perl Makefile.PL --cflags=-I<dir>

to set this directory. For details see the INSTALL.html file,
section "C Compiler flags" or type

perl Makefile.PL --help
[root@lintest11 DBD-mysql-4.019]#

---------------------------------------------
MySQL is installed @ /usr/lib/mysql

modified the /etc/ld.so.conf as

include ld.so.conf.d/*.conf
LD_RUN_PATH=/usr/lib/mysql export LD_RUN_PATH
LD_LIBRARY_PATH=/usr/lib/mysql export LD_LIBRARY_PATH
------------------------------------------------
OS Details
[root@lintest11]# cat /etc/issue
CentOS release 5.4 (Final)
Kernel \r on an \m


asandybox
Novice

Sep 16, 2011, 4:59 AM

Post #2 of 3 (13637 views)
Re: [thala] Unable to install DBD:mysql [In reply to] Can't Post

Hi, any reason why you are trying to custom build these modules. I see your running centos 5. You should be able to just install the following:

perl-DBI, perl-DBD-MySQL without the need for compilation since the packages required to connect to mysql from perl are provided via rpms.


1arryb
User

Sep 16, 2011, 9:12 AM

Post #3 of 3 (13630 views)
Re: [thala] Unable to install DBD:mysql [In reply to] Can't Post

Hi thala,

I'm with asandybox - definitely use the rpms if they are available. However, if this is somehow impossible, you're problem is probably that you haven't installed the mysql-devel package which is required to successfully compile dbd-mysql.

The other possibility is that you have installed the mysql-devel package but mysql's bin directory (which contains mysql_config) isn't in your shell's execution PATH.

There are several layers to this onion. Be patient and read the CPAN make output carefully.

Cheers,

Larry

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives