Hello,
I am using activestate perl 5.16.3 on win7-64. This version of perl came with DBI, but it did not come with DBD::mysql. i used the ppm to search for DBD-mysql, but but it was not listed (other versions were there; csv, odbc, etc). so i went to cpan and downloaded the module from this link:
http://search.cpan.org/~capttofu/DBD-mysql-4.027/lib/DBD/mysql.pm
i extracted the files and copied them in the following directories:
- mysql.pm -> C:\Perl64\lib\DBD
- mysql\GetInfo.pm -> C:\Perl64\lib\DBD\mysql
- mysql\INSTALL.pod -> C:\Perl64\lib\DBD\mysql
here is a stripped down code snippet of how i am using DBI
use DBI;
my $url = sprintf('DBI:%s:%s:%s', $driver, $database, $hostname);
my $dbh = DBI->connect(
$url,
$username,
$password,
{RaiseError => 1, AutoCommit => 1}
)
when i run that code, i get the following error:
install_driver(mysql) failed: Can't locate loadable object for module
+DBD::mysql in @INC (@INC contains: ../ C:\Program Files (x86)\ActiveS
+tate Komodo IDE 8\lib\support\dbgp\perllib c:/Perl64/site/lib c:/Perl
+64/lib .) at (eval 31)[c:/Perl64/lib/DBI.pm:783] line 3.
Compilation failed in require at (eval 31)[c:/Perl64/lib/DBI.pm:783] l
+ine 3.
Perhaps a module that DBD::mysql requires hasn't been fully installed
i know the DBD-mysql files are in the correct paths, but it sounds like this module isnt installed correctly?
what am i missing here? does DBD-mysql work with 5.16.3? i know that i have used that module in earlier versions of perl.
thanks,
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.