in reply to Re: Re: Installing DBD problems
in thread Installing DBD problems

I do not usually work on Linux, but on Solaris/HP/SGI/etc, this is sometimes caused by not having the MySQL .so (mysql.so) file in the LD_LIBRARY_PATH environment variable. I would check $LD_LIBRARY_PATH and $SHLIB_PATH, and make sure that both contain the directory your mysql library is in (not sure which of the two environment variables is used by Linux.)

Also, and i hate to say this, but another test is to run make install, and then try to use the driver. I have seen the DBD::Sybase driver fail 90% of tests, and still work once installed (usually because of path setups).

Replies are listed 'Best First'.
Re: Re: Re: Re: Installing DBD problems
by costas (Scribe) on Oct 16, 2001 at 13:49 UTC
    I ran make install and something seems to have improved. When I run the script
    use strict; use DBI; #probe DBI for available drivers my @drivers = DBI->available_drivers(); ##iterate through drivers and list the data source for each one foreach my $driver (@drivers) { print "Driver: $driver<br>"; if ($driver ne "Proxy" && $driver ne "Multiplex") ##DBD:Proxy and +DBD::Multiplex have problem with datasources { my @datasources = DBI->data_sources($driver); foreach my $datasource (@datasources) { print "\tData Source is $datasource<br>"; } } print "\n"; }

    i get the following
    Driver: ExampleP Data Source is dbi:ExampleP:dir=. Driver: Proxy Driver: mysql


    However, I am a bit suspect as make test still returns errors (as in previous post) and I cant get a DBD-mysql (which used to work on a differen setup) script to run succesfully.

    I want to try adding the lib path to the environmental variables but am a little uncertain as to how to do this. Could you point me in the right direction with regards to adding to env vars.

    thankyou in advance
      If this is a non-csh shell, the following should work. Lets assume your mysql library is in /usr/mysql/lib :
      ### Check current value (possibly SHLIB_PATH) prompt > echo $LD_LIBRARY_PATH /usr/local/lib:/usr/lib ### Add new path prompt > LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/mysql/lib prompt > export LD_LIBRARY_PATH ### Test it out prompt > ./your_test_program.pl Driver: ExampleP Data Source is dbi:ExampleP:dir=. Driver: Proxy Driver: mysql prompt > ### lather, rince, repeat

      But, using make install was not meant to fix make test, but to ignore the errors. That is why i prefer not to do it that way. You said a program which worked elsewhere fails ... i would suggest writting a short bit of code to login to a mysql server, and do a select * ... if that works, the Driver is loading (which is what failed in make test), and the problem is either the version, or something else all together.