首页 文章

在Windows上安装perl mysql模块失败

提问于
浏览
2

我正在尝试使用以下命令安装mysql:

cpanm DBD::mysql

我得到这样的输出错误:设置gcc环境 - 3.4.5(mingw-vista special r3) - >工作DBD :: mysql获取http://www.cpan.org/authors/id/C/CA/ CAPTTOFU / DBD-mysql-4.025.tar.gz ...确定配置DBD-mysql-4.025 ...确定构建和测试DBD-mysql-4.025 ...失败!安装DBD :: mysql失败 . 有关详细信息,请参阅C:\ Users \ myuser \ cpanm \ work \ 1384776992.9536 \ build.log . 使用--force重试强制安装它

当我打开日志文件来检查细节时,它就像风箱一样 . 有没有人帮助我:

cpanm (App::cpanminus) 1.7001 on perl 5.012004 built for MSWin32-x86-multi-thread
Work directory is C:\Users\myuser/.cpanm/work/1384776992.9536
You have make C:\Perl\site\bin\dmake.exe
You have LWP 6.02
Falling back to Archive::Tar 1.76
Searching DBD::mysql on cpanmetadb ...
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.025.tar.gz
-> OK
Unpacking DBD-mysql-4.025.tar.gz
Entering DBD-mysql-4.025
Checking configure dependencies from META.yml
Checking if you have DBI 1.08 ... Yes (1.616)
Configuring DBD-mysql-4.025
Running Makefile.PL
Set up gcc environment - 3.4.5 (mingw-vista special r3)

mysql_config.pl, and an associated bat file, has been
successfully created under
   C:\PROGRA~1\MySQL\MYSQLS~1.1\bin

Unknown option: testdb
Unknown option: testhost
Unknown option: testuser


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

Unknown option: testpassword
Unknown option: testsocket
Unknown option: testport
Unknown option: nocatchstderr
Unknown option: ssl
Unknown option: nofoundrows
Unknown option: force-embedded
I will use the following settings for compiling and testing:

 cflags        (mysql_config) = -I"C:\PROGRA~1\MySQL\MYSQLS~1.1\include"
  embedded      (mysql_config) = 
  ldflags       (mysql_config) = 
 libs          (mysql_config) = -LC:\PROGRA~1\MySQL\MYSQLS~1.1\lib\opt -lmysqlclient -lzlib
mysql_config  (guessed     ) = mysql_config
nocatchstderr (default     ) = 0
nofoundrows   (default     ) = 0
ssl           (guessed     ) = 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 your kit is complete...
Warning: the following files are missing in your kit:
META.json
t/mem_leak.pl
Please inform the author.
Note (probably harmless): No library found for -lmysqlclient
Note (probably harmless): No library found for -lzlib
Using DBI 1.616 (for perl 5.012004 on MSWin32-x86-multi-thread) installed in       C:/Perl/lib/auto/DBI/
Writing Makefile for DBD::mysql
-> OK
Finding PREREQ from Makefile ...
Checking if you have Test::More 0 ... Yes (0.98)
Checking if you have Data::Dumper 0 ... Yes (2.128)
Checking if you have Test::Deep 0 ... Yes (0.110)
Checking if you have DBI 1.08 ... Yes (1.616)
Building and testing DBD-mysql-4.025
cp lib/DBD/mysql.pm blib\lib\DBD\mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib\lib\DBD\mysql\GetInfo.pm
cp README.pod blib\lib\DBD\README.pod
cp lib/DBD/mysql/INSTALL.pod blib\lib\DBD\mysql\INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib\lib\Bundle\DBD\mysql.pm
C:/Perl/site/bin/gcc.exe -c  -IC:\Perl\lib\auto\DBI -I"C:\PROGRA~1\MySQL\MYSQLS~1.1\include" -  DDBD_MYSQL_INSERT_ID_IS_GOOD -g     -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME_T -DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields -O2       -DVERSION=\"4.025\"   -DXS_VERSION=\"4.025\"  "-IC:\Perl\lib\CORE"   dbdimp.c
In file included from dbdimp.c:18:
dbdimp.h:21:49: mysql.h: No such file or directory
dbdimp.h:22:45: mysqld_error.h: No such file or directory
dbdimp.h:24:49: errmsg.h: No such file or directory
In file included from dbdimp.c:18:
dbdimp.h:157: error: syntax error before "MYSQL"
dbdimp.h:157: warning: no semicolon at end of struct or union
dbdimp.h:180: error: syntax error before '}' token
dbdimp.h:255: error: syntax error before "MYSQL_RES"
dbdimp.h:255: warning: no semicolon at end of struct or union
dbdimp.h:258: error: syntax error before "row_num"
dbdimp.h:258: warning: data definition has no type or storage class
dbdimp.h:263: error: syntax error before "insertid"
dbdimp.h:263: warning: data definition has no type or storage class
dbdimp.h:267: error: conflicting types for 'use_mysql_use_result'
dbdimp.h:165: error: previous declaration of 'use_mysql_use_result' was here
dbdimp.h:274: error: syntax error before '}' token
...............................................
-> FAIL Installing DBD::mysql failed. See C:\Users\wangw35\.cpanm\work\1384776992.9536\build.log for details. Retry with --force to force install it.

1 回答

  • 0

    这是两条重要的路线 .

    注意(可能无害):找不到-lmysqlclient的库注意(可能无害):找不到-lzlib的库

    您需要在系统上安装mysqlclient(以及zlib) .

相关问题