1

我正在尝试安装此软件包: https ://metacpan.org/pod/DBD::mysql::INSTALL

我在我的系统上配置了 mysql。

我正在尝试执行 cmds:

perl Makefile.PL
make
make test
make install

这是`perl Makefile.PL make 的输出

E:\umls_perl\DBD-mysql-4.050>perl Makefile.PL


PLEASE NOTE:

For 'make test' to run properly, you must ensure that the
database user '' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.

mysql> grant all privileges on test.* to ''@'localhost' identified by 's3kr1t';

You can also optionally set the user to run 'make test' with:

perl Makefile.PL --testuser=username

I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -IC:\Strawberry\c\bin\..\include\mysql50716
  embedded      (guessed     ) =
  ldflags       (guessed     ) =
  libs          (mysql_config) = -LC:\Strawberry\c\bin\..\lib -lmysql
  mysql_config  (guessed     ) = mysql_config
  nocatchstderr (default     ) = 0
  nofoundrows   (default     ) = 0
  nossl         (default     ) = 0
  testdb        (default     ) = test
  testhost      (default     ) =
  testpassword  (default     ) =
  testport      (default     ) =
  testsocket    (default     ) =
  testuser      (guessed     ) =

To change these settings, see 'perl Makefile.PL --help' and
'perldoc DBD::mysql::INSTALL'.

Checking if libs are available for compiling...
Looks good.

Checking if your kit is complete...
Looks good
Multiple copies of Driver.xst found in: C:/Strawberry/perl/site/lib/auto/DBI/ C:/Strawberry/perl/vendor/lib/auto/DBI/ at Makefile.PL line 896.
Using DBI 1.642 (for perl 5.030000 on MSWin32-x64-multi-thread) installed in C:/Strawberry/perl/site/lib/auto/DBI/
Generating a gmake-style Makefile
Writing Makefile for DBD::mysql
Writing MYMETA.yml and MYMETA.json

E:\umls_perl\DBD-mysql-4.050>make
cp lib/Bundle/DBD/mysql.pm blib\lib\Bundle\DBD\mysql.pm
cp lib/DBD/mysql/INSTALL.pod blib\lib\DBD\mysql\INSTALL.pod
cp lib/DBD/mysql.pm blib\lib\DBD\mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib\lib\DBD\mysql\GetInfo.pm
Running Mkbootstrap for mysql ()
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 644 "mysql.bs"
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- mysql.bs blib\arch\auto\DBD\mysql\mysql.bs 644
gcc -c  -IC:\Strawberry\perl\site\lib\auto\DBI -IC:\Strawberry\c\bin\..\include\mysql50716 -DDBD_MYSQL_WITH_SSL -g  -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -s -O2   -DVERSION=\"4.050\" -DXS_VERSION=\"4.050\"  "-IC:\STRAWB~1\perl\lib\CORE"   dbdimp.c
In file included from C:\Strawberry\perl\site\lib\auto\DBI/DBIXS.h:38,
                 from dbdimp.h:20,
                 from dbdimp.c:15:
C:\Strawberry\perl\site\lib\auto\DBI/dbipport.h:4471: warning: "WIDEST_UTYPE" redefined
 #  define WIDEST_UTYPE U64TYPE

In file included from C:\STRAWB~1\perl\lib\CORE/perl.h:2508,
                 from C:\Strawberry\perl\site\lib\auto\DBI/DBIXS.h:23,
                 from dbdimp.h:20,
                 from dbdimp.c:15:
C:\STRAWB~1\perl\lib\CORE/handy.h:1072: note: this is the location of the previous definition
 #   define WIDEST_UTYPE U64

dbdimp.c: In function 'mysql_st_prepare':
dbdimp.c:3207:24: warning: assignment to 'my_bool *' {aka 'char *'} from incompatible pointer type '_Bool *' [-Wincompatible-pointer-types]
           bind->is_null=      (_Bool*) &(fbind->is_null);
                        ^
"C:\Strawberry\perl\bin\perl.exe" -p -e "s/~DRIVER~/mysql/g" C:\Strawberry\perl\site\lib\auto\DBI\Driver.xst > mysql.xsi
"C:\Strawberry\perl\bin\perl.exe" "C:\Strawberry\perl\lib\ExtUtils/xsubpp"  -typemap C:\STRAWB~1\perl\lib\ExtUtils\typemap  mysql.xs > mysql.xsc
Warning: duplicate function definition 'do' detected in mysql.xs, line 247
Warning: duplicate function definition 'rows' detected in mysql.xs, line 683
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e mv -- mysql.xsc mysql.c
gcc -c  -IC:\Strawberry\perl\site\lib\auto\DBI -IC:\Strawberry\c\bin\..\include\mysql50716 -DDBD_MYSQL_WITH_SSL -g  -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -s -O2   -DVERSION=\"4.050\" -DXS_VERSION=\"4.050\"  "-IC:\STRAWB~1\perl\lib\CORE"   mysql.c
In file included from C:\Strawberry\perl\site\lib\auto\DBI/DBIXS.h:38,
                 from dbdimp.h:20,
                 from mysql.xs:12:
C:\Strawberry\perl\site\lib\auto\DBI/dbipport.h:4471: warning: "WIDEST_UTYPE" redefined
 #  define WIDEST_UTYPE U64TYPE

In file included from C:\STRAWB~1\perl\lib\CORE/perl.h:2508,
                 from C:\Strawberry\perl\site\lib\auto\DBI/DBIXS.h:23,
                 from dbdimp.h:20,
                 from mysql.xs:12:
C:\STRAWB~1\perl\lib\CORE/handy.h:1072: note: this is the location of the previous definition
 #   define WIDEST_UTYPE U64

gcc -c  -IC:\Strawberry\perl\site\lib\auto\DBI -IC:\Strawberry\c\bin\..\include\mysql50716 -DDBD_MYSQL_WITH_SSL -g  -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -s -O2   -DVERSION=\"4.050\" -DXS_VERSION=\"4.050\"  "-IC:\STRAWB~1\perl\lib\CORE"   socket.c
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Mksymlists \
     -e "Mksymlists('NAME'=>\"DBD::mysql\", 'DLBASE' => 'mysql', 'DL_FUNCS' => {  }, 'FUNCLIST' => [], 'IMPORTS' => {  }, 'DL_VARS' => []);"
g++ mysql.def -o blib\arch\auto\DBD\mysql\mysql.xs.dll -mdll -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib" dbdimp.o mysql.o socket.o   "C:\STRAWB~1\perl\lib\CORE\libperl530.a" "C:\Strawberry\c\bin\..\lib\libmysql.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmoldname.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libkernel32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuser32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libgdi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinspool.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomdlg32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libadvapi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libshell32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libole32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\liboleaut32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libnetapi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuuid.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libws2_32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmpr.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinmm.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libversion.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbc32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbccp32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomctl32.a" -Wl,--enable-auto-image-base
collect2.exe: error: ld returned 5 exit status
make: *** [blib\arch\auto\DBD\mysql\mysql.xs.dll] Error 1

我已将 mysql 添加到环境变量中,尝试在运行 Makefile 时附加 mysql 配置,如下所示:

perl Makefile.PL --mysql_config="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini"

我在 Linux 上也遇到过类似的问题。我不明白安装此软件包的正确方法是什么。很高兴在这个问题上得到一些建议。谢谢。

4

0 回答 0