sdyates has asked for the wisdom of the Perl Monks concerning the following question:
My code ran fine on Redhat linux. I was able to connect tot he same version of MYSQL: 3.23.
The code is now running on FreeBSD 4.8. The code is fine, but I cannot connect to the DB. I have installed the DBD and the dbi driver, before I pull my hair out, I seek the wisdom of the monks to point me in the right direction.
Error Message
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC +contains: /usr/local/lib/perl5/5.8.7/i386-freebsd /usr/local/lib/perl +5/5.8.7 /usr/local/lib/perl5/site_perl/5.8.7/i386-freebsd /usr/local/ +lib/perl5/site_perl/5.8.7 /usr/local/lib/perl5/site_perl/5.6.2 /usr/l +ocal/lib/perl5/site_perl/5.005 /usr/local/lib/perl5/site_perl .) at ( +eval 10) line 3. Perhaps the DBD::mysql perl module hasn't been fully installed, or perhaps the capitalisation of 'mysql' isn't right. Available drivers: ADO, ExampleP, Multiplex, Proxy. at /usr/local/apache/cgi-bin/ISee/ISeeSupportDisplaySWAT.pl line 164
code generating message
my $dbh = DBI->connect("dbi:mysql:$DBName:$IP", "$db_user", "$db_passw +ord", {RaiseError => 0, PrintError => 0} ) or err_trap("Cannot connect to the database");
I tried adding an extra : in the code between dbi::mysql and was surprised to get the followinf error messahe
Can't connect(dbi::mysql:support: username password HASH(0x842cb58)), +no database driver specified and DBI_DSN env var not set at /usr/loca +l/apache/cgi-bin/ISee/ISeeSupportDisplaySWAT.pl line 163
Any thoughts?
Am I using the wrong drivers? ----- 11jan06: Update. First, thanks again for your comments. It's nice to have a second voice over my shoulder.
On Linux, I used ppm, but could not find it on Unix, however, I did find MCPAN and used it to properly set up DBD abd DBI. Here is what I used:
perl -MCPAN -e 'install DBI' perl -MCPAN -e 'install DBD::mysql'So thanks for the help, and I hope my update will assist others.
Signed, one of the faithful greatful ;)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't Connect to MySQL after port
by suaveant (Parson) on Jan 10, 2006 at 04:30 UTC | |
|
Re: Can't Connect to MySQL after port
by jZed (Prior) on Jan 10, 2006 at 05:46 UTC |