On Windows, you should do the following to install the MySQL
DBD
module with ActiveState Perl:
Get ActiveState Perl from http://www.activestate.com/Products/ActivePerl/ and install it.
Open a console window.
If necessary, set the
HTTP_proxy
variable. For example, you might try a setting like this:C:\> set HTTP_proxy=my.proxy.com:3128
Start the PPM program:
C:\> C:\perl\bin\ppm.pl
If you have not previously done so, install
DBI
:ppm> install DBI
If this succeeds, run the following command:
ppm> install DBD-mysql
This procedure should work with ActiveState Perl 5.6 or higher.
If you cannot get the procedure to work, you should install the ODBC driver instead and connect to the MySQL server through ODBC:
use DBI;
$dbh= DBI->connect("DBI:ODBC:$dsn",$user,$password) ||
die "Got error $DBI::errstr when connecting to $dsn\n";
On this page I followed this link http://www.activestate.com/Products/ActivePerl/ and downloaded the free standard version. Needless to say it was a zipped file which i unzipped to a new folder I created on my C: drive.
In that folder was a file called Installer.bat. I double clicked the file and the package installed via the command prompt window (got asked a series of questions:), nevertheless it installed - phew!!
I then followed Nish's instructions to check the version and change directories and execute the command:
c:\perl\bin>ppm
a lovely GUI opened! and I was able to see what packages were installed and what were not. DBI was already installed (no work for me there) DBD-MySQl was not so I simply highlighted the package I wanted to install and the ppm downloaded the file for me. All that was left to do was to use the icon in the ppm (marked 'run') and - hey presto - DBD MySQL was installed for me - genius - :)
Now I can start figuring where is the best place to learn how to write perl code to work with MySQL and trying it out on my machine.
This worked on windows xp with sp2
ppm rep add http://theoryx5.uwinnipeg.ca/ppms/
ppm install dbd-mysql
For reference, you can read the full tutorial/walk-through here:
http://www.chriscalender.com/?p=251