1

I installed the new ActiveState Perl custom build with Perl 5.28 and I added the module (DBD-mysql v4.50). The DBI module is set by default to the ActivePerl 5.28 compilation.

use strict;
use warnings;
use diagnostics;
use DBI;

### INIT DB CONNECTION
my $dbh = DBI->connect("DBI:mysql:database=testdb;host=localhost","root", "XXXX",{'RaiseError' => 1,'mysql_auto_reconnect' => 1});
$dbh->{InactiveDestroy} = 1;
$dbh->{mysql_auto_reconnect} = 1;

then I get the following error:

>perl test.pl
Uncaught exception from user code:
        install_driver(mysql) failed: Can't load 'C:/Perl64/lib/auto/DBD/mysql/mysql.dll' for module DBD::mysql: load_file:The specified module could not be found at C:/Perl64/lib/DynaLoader.pm line 193.
          at (eval 9) line 3.
        Compilation failed in require at (eval 9) line 3.
        Perhaps a required shared library or dll isn't installed where expected
         at test.pl line 15.
        DBI::install_driver("DBI", "mysql") called at C:/Perl64/site/lib/DBI.pm line 660
        DBI::connect("DBI", "DBI:mysql:database=testdb;host=localhost", "root", "XXXX", HASH(0x109b408)) called at test.pl line 15

Trying from CPAN directly. Nothing changed.

cpan[2]> install DBD::mysql
DBD::mysql is up to date (4.050).

The file C:/Perl64/lib/auto/DBD/mysql/mysql.dll Exist.

I have seek for information and I tryed to reinstall Perl package from EXE and MSI. I tryed to manually reinstall from CPAN console and many other things but It isn't working at all. Any solution or sugestion?

bLIGU
  • 45
  • 6
  • 1
    How did you add DBD-mysql? It requires the MySQL client library be installed. It's probably best to [install it via ppm](https://docs.activestate.com/activeperl/5.12/faq/ActivePerl-faq2.html). – Schwern Dec 29 '19 at 16:17
  • 1
    Note that the error doesn't necessarily refer to mysql.dll itself; it could refer to a library linked to it (e.g. the actual mysql library) – ikegami Dec 29 '19 at 17:09
  • 2
    @Schwern The guys at ActivePerl have made changes and removed the installer via PPM. Now, you must create a project online and create a build with modules. – bLIGU Dec 29 '19 at 17:21
  • @bLIGU, Sure but what happen with the old projects that require DBD-mysql? – The Anh Nguyen Mar 15 '21 at 09:04

0 Answers0