bobafett has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I have a perl script that connects to mysql and it works well. I am trying to share this script over nfs so that others can use it and am running into library path issues. The error that is reported is : -------------------------------
install_driver(mysql) failed: Can't load '/net/abc.host/app/local/lib/ +perl5/site_perl/5.8.3/sun4-solaris/auto/DBD/mysql/mysql.so' for modul +e DBD::mysql: ld.so.1: perl: fatal: libmysqlclient.so.15: open failed +: No such file or directory at /net/abc.host/app/local/lib/perl5/5.8. +3/sun4-solaris/DynaLoader.pm line 229, <STDIN> line 1. at (eval 1) line 3 Compilation failed in require at (eval 1) line 3, <STDIN> line 1. Perhaps a required shared library or dll isn't installed where expecte +d My perl script has the env set as follows ----------------------------------------- BEGIN { @INC = qw( # /net/abc.host/app/local/mysql/lib/mysql /net/abc.host/app/local/lib/perl5/5.8.3 /net/abc.host/app/local/lib/perl5/5.8.3/sun4-solaris /net/abc.host/app/local/lib/perl5/site_perl /net/abc.host/app/local/lib/perl5/site_perl/5.8.3 /net/abc.host/app/local/lib/perl5/site_perl/5.8.3/sun4-solaris /net/abc.host/app/local/lib/perl5/site_perl/5.8.3/sun4-solaris/auto/DB +D/mysql ); } use lib '/net/abc.host/export/oracle_apps/app/local/mysql/lib/mysql'; Tried to list the libraries successfully from nfs location ---------------------------------------------------------- # ls /net/abc.host/app/local/mysql/lib/mysql/libmysqlclient.so.15 /net/abc.host/app/local/mysql/lib/mysql/libmysqlclient.so.15 # ls /net/abc.host/app/local/lib/perl5/site_perl/5.8.3/sun4-solaris/au +to/DBD/mysql/mysql.so /net/abc.host/app/local/lib/perl5/site_perl/5.8.3/sun4-solaris/auto/DB +D/mysql/mysql.so* Not sure what I am missing here.. any help appreciated.. Thanks

Replies are listed 'Best First'.
Re: Share perl dbi/mysql script over nfs
by roboticus (Chancellor) on Mar 12, 2008 at 03:55 UTC
    This has been discussed before, so you can use Super Search to see the earlier solutions. I think I recall a couple of the solutions as being:

    • Set up some symbolic links on your machines to make the paths look the same.
    • Do some of the setup in your environment on the different machines rather than hardcode it in your script

    ...roboticus