Error using perl module DBD::mysql in ActivePerl 5.28 on Windws10 64bits

时光毁灭记忆、已成空白 提交于 2021-02-19 08:01:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!