mysql - perl mysql 模块在 Windows 上安装失败

标签 mysql perl

我正在尝试使用以下方法安装 mysql:

cpanm DBD::mysql

我得到这样的输出错误:Set up gcc environment - 3.4.5 (mingw-vista special r3) --> 处理 DBD::mysql 正在获取 http://www.cpan.org/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.025.tar.gz ... OK 配置 DBD-mysql-4.025 ... OK 构建和测试 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.

最佳答案

这是两条重要的线。

Note (probably harmless): No library found for -lmysqlclient

Note (probably harmless): No library found for -lzlib

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

关于mysql - perl mysql 模块在 Windows 上安装失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20048021/

相关文章:

php - 在插入查询中设置的内爆数组

php - Codeigniter mysql将中文数据存储为问号

perl - 返回具有单个元素的数组或列表时的列表或标量上下文

mysql - SQL 复合键语法

java - 如何使用更新的 JPA 时间戳字段升级数据库?

perl - 在匹配的文本之间插入换行符会被覆盖

python - 如何在 perl 或 python 中搜索文件中某个范围内的所有位置?

perl mocking 有没有办法模拟 $?

perl - 如何让一个 Perl 脚本查看另一个 Perl 脚本中的变量?

mysql - VB.Net 使用唯一键更新 MySQL