问题
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?
来源:https://stackoverflow.com/questions/59521072/error-using-perl-module-dbdmysql-in-activeperl-5-28-on-windws10-64bits