jck has asked for the wisdom of the Perl Monks concerning the following question:
I have a script that has worked for years, but now it's throwing an error, pointing to the line that attempts to connect to my database.
line 3: use DBI; ... line 20: my $dbh = DBI->connect('DBI:mysql:database_name1;host=localho +st;port=3306', 'username', 'password') or die "Couldn't open database: $DBI::errstr; stopped"; line 22: my $dbh2 = DBI->connect('DBI:mysql:database_name2;host=localh +ost;port=3306', 'username', 'password') or die "Couldn't open database: $DBI::errstr; stopped";
the error message is as follows:
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /home/domainname/public_html/cgi-bin/ //perl5/lib/perl +5 //perl5/lib/perl5/x86_64-linux-thread-multi //perl/usr/local/lib64/per +l5 //perl/usr/local/share/perl5 //perl/usr/lib64/perl5/vendor_perl //perl/usr/share/perl5/vendor_perl //perl/usr/lib64/perl5 //perl/usr/share/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/p +erl5 /usr/share/perl5 .) at (eval 18) line 3. Perhaps the DBD::mysql perl module hasn't been fully installed, or perhaps the capitalisation of 'mysql' isn't right. Available drivers: DBM, ExampleP, File, Gofer, Mem, Proxy, SQLite, Spo +nge. at /home/domainname/public_html/cgi-bin/events_db_embed.pl line 20.
should I replace DBI with one of the following? DBM, ExampleP, File, Gofer, Mem, Proxy, SQLite, Sponge.
just as an addendum, I search for DBI as an available module, and it's not listed on my host
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: replacement for DBI?
by NetWallah (Canon) on Oct 02, 2020 at 00:01 UTC | |
by jck (Scribe) on Oct 02, 2020 at 00:34 UTC | |
Re: replacement for DBI?
by LanX (Saint) on Oct 01, 2020 at 23:58 UTC | |
by jck (Scribe) on Oct 02, 2020 at 00:13 UTC | |
by 1nickt (Canon) on Oct 02, 2020 at 00:23 UTC | |
by jck (Scribe) on Oct 02, 2020 at 00:26 UTC | |
by 1nickt (Canon) on Oct 02, 2020 at 00:38 UTC | |
| |
Re: replacement for DBI?
by 1nickt (Canon) on Oct 02, 2020 at 00:21 UTC | |
by jck (Scribe) on Oct 02, 2020 at 00:28 UTC | |
by parv (Parson) on Oct 02, 2020 at 00:46 UTC | |
by jck (Scribe) on Oct 02, 2020 at 00:57 UTC | |
Re: replacement for DBI?
by Anonymous Monk on Oct 02, 2020 at 00:07 UTC | |
by jck (Scribe) on Oct 02, 2020 at 00:25 UTC | |
by Anonymous Monk on Oct 02, 2020 at 15:43 UTC | |
by jck (Scribe) on Oct 02, 2020 at 16:18 UTC | |
by soonix (Canon) on Oct 02, 2020 at 19:43 UTC |
Back to
Seekers of Perl Wisdom