LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   MySQL / DBD / DBI problems (https://www.linuxquestions.org/questions/linux-software-2/mysql-dbd-dbi-problems-206894/)

drowning 07-19-2004 07:10 AM

MySQL / DBD / DBI problems
 
I am trying to install perl-DBD-MySQL so that I can access mysql from perl cgi scripts. I have installed
mysql-server 4.0.20,
mysql-client 4.0.20,
perl-DBI 1.40-4,
perl-DBD-mysql 2.9003-4 and
mysql-shared-compat 4.0.20 (because DBD needed libmysqlclient.so.10).

Problem is it get the following error when executing a cgi script:

install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /usr/lib/perl5/5.8.1/i386-linux-thread-multi /usr/lib/perl5/5.8.1 /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.1/i386-linux-thread-multi /usr/lib/perl5/5.8.1 .) at (eval 1) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: ExampleP, Proxy, Sponge.
at ./accounts.cgi line 37

I know mysql is working as I can login and create db's and the sort.
I can only assume that the DBI and DBD versions I have installed are not compatible with either the version of perl or mysql that I am running.
If this is the case which vers of each should I be installing?

I am running Fedora Core 1
Perl v5.8.1

Is anybody able to tell me what I am doing wrong or what I am missing - or even better, how to fix this frustrating problem?


--------------------------------
Steve

david_ross 07-19-2004 07:21 AM

Try installing with CPAN:
perl -MCPAN -eshell

If this is your first time using it then answer the config questions. Then at the "cpan>" prompt:
install DBD::mysql

drowning 07-19-2004 07:46 AM

Thanks for the quick response.

I tried that but when attempting to install DBD::mysql it couldn't find certain things and therefore the end result was it didn't install it.

Would it advisable to uninstall all the above RPMS and install them using the command you mentioned above? if so is there a way of finding out the specific name of the package I want to install? Eg. will ">install mysql-server" work. I would assume I would have to enter the specific name of a package.

Sorry if these questions are stupid. I am relatively new to linux.
---------------------------------
Steve

david_ross 07-19-2004 08:39 AM

I wouldn't uninstall the rpms. CPAN will only install perl modules. Saying "it couldn't find certain things and therefore the end result was it didn't install it." isn't really very helpful as there is know way for us to know what is going wrong. Perhaps you could copy and paste the exact output that was given to you. This makes it much easier to see why things went wrong.

drowning 07-19-2004 04:48 PM

Here's the output from the attempt:
--------------------
cpan> install DBD::mysql
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
Database was generated on Sun, 18 Jul 2004 05:11:52 GMT
Running install for module DBD::mysql
Running make for R/RU/RUDY/DBD-mysql-2.9004.tar.gz
CPAN: Digest::MD5 loaded ok
Checksum for /root/.cpan/sources/authors/id/R/RU/RUDY/DBD-mysql-2.9004.tar.gz ok
Scanning cache /root/.cpan/build for sizes
DBD-mysql-2.9004/
DBD-mysql-2.9004/t/
DBD-mysql-2.9004/t/mysql2.t
DBD-mysql-2.9004/t/akmisc.t
DBD-mysql-2.9004/t/60leaks.t
DBD-mysql-2.9004/t/10dsnlist.t
DBD-mysql-2.9004/t/ak-dbd.t
DBD-mysql-2.9004/t/50chopblanks.t
DBD-mysql-2.9004/t/mysql.t
DBD-mysql-2.9004/t/lib.pl
DBD-mysql-2.9004/t/40blobs.t
DBD-mysql-2.9004/t/40nulls.t
DBD-mysql-2.9004/t/insertid.t
DBD-mysql-2.9004/t/40listfields.t
DBD-mysql-2.9004/t/40bindparam.t
DBD-mysql-2.9004/t/mysql.dbtest
DBD-mysql-2.9004/t/dbdadmin.t
DBD-mysql-2.9004/t/20createdrop.t
DBD-mysql-2.9004/t/00base.t
DBD-mysql-2.9004/t/30insertfetch.t
DBD-mysql-2.9004/t/40numrows.t
DBD-mysql-2.9004/t/50commit.t
DBD-mysql-2.9004/t/mysql.mtest
DBD-mysql-2.9004/MANIFEST
DBD-mysql-2.9004/myld
DBD-mysql-2.9004/dbdimp.c
DBD-mysql-2.9004/lib/
DBD-mysql-2.9004/lib/DBD/
DBD-mysql-2.9004/lib/DBD/mysql/
DBD-mysql-2.9004/lib/DBD/mysql/GetInfo.pm
DBD-mysql-2.9004/lib/DBD/mysql/INSTALL.pod
DBD-mysql-2.9004/lib/DBD/mysql.pm
DBD-mysql-2.9004/lib/Mysql/
DBD-mysql-2.9004/lib/Mysql/Statement.pm
DBD-mysql-2.9004/lib/Bundle/
DBD-mysql-2.9004/lib/Bundle/DBD/
DBD-mysql-2.9004/lib/Bundle/DBD/mysql.pm
DBD-mysql-2.9004/lib/Mysql.pm
DBD-mysql-2.9004/dbdimp.h
DBD-mysql-2.9004/mysql.xs
DBD-mysql-2.9004/MANIFEST.SKIP
DBD-mysql-2.9004/README
DBD-mysql-2.9004/INSTALL.html
DBD-mysql-2.9004/META.yml
DBD-mysql-2.9004/Makefile.PL
DBD-mysql-2.9004/ChangeLog
DBD-mysql-2.9004/constants.h
DBD-mysql-2.9004/TODO
Removing previously used /root/.cpan/build/DBD-mysql-2.9004

CPAN.pm: Going to build R/RU/RUDY/DBD-mysql-2.9004.tar.gz

Can't exec "mysql_config": No such file or directory at Makefile.PL line 174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
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>
---------------
I have done a locate mysql_config but it (obviously) doesn't exist.

--------------------------------------------
Steve

david_ross 07-19-2004 04:55 PM

mqsql_config should come with the mysql client. How did you install mysql?

drowning 07-19-2004 05:16 PM

Firstly I installed MySQL-server-4.0.20-0.i386.rpm
Code:

rpm -i MySQL-server-4.0.20-0.i386.rpm
Secondly I installed MySQL-client-4.0.20-0.i386.rpm
Code:

rpm -i MySQL-client-4.0.20-0.i386.rpm
Then I created a root password
Code:

/usr/bin/mysqladmin -u root password passwd
Did I miss a package?

--------------------------------------------
Steve:(

drowning 07-20-2004 04:17 AM

Does anybody have MySQL, perl-DBD-MySQL and perl-DBI running on Fedora Core? If so what versions are you using. I'll try anything.

All help is appreciated
-------------------------------------------------
Steve

kaN5300 11-30-2004 04:59 AM

For DBD-mysql u must edit Makefile.PL to fix a path to ur mysql_config program =)

NomadX 09-19-2005 12:01 AM

an old thread but....
 
You must install the mysql-dev package to get mysql_config ... dont ask me what its called on fedora because I use debian :)


All times are GMT -5. The time now is 05:29 AM.