我在win8环境中安装了DBD-mysql,但它显示如下错误。
我使用ActivePerl 5.10,mysql 5.5。任何人都可以帮助我吗?
事实上,我不想从源代码安装。但要找到ppm包装并不容易。
如果没有添加某个系统路径,那么它将很容易处理。但是这个错误显示需要一些windows库,那么我真的不知道如何设置和设置这个,因为这意味着我应该更改DBD-mysql的源代码?但每次我使用' perl -MCPAN -e"安装DBD :: mysql" '命令安装,它下载一个新的DBD-mysql包,所以即使我在本地修改了代码,也没用。
Creating library blib\arch\auto\DBD\mysql\mysql.lib and object blib\arch\auto
\DBD\mysql\mysql.exp
mysqlclient.lib(handshake_client.obj) : error LNK2019: unresolved external symbo
l __imp__InitializeSecurityContextW@48 referenced in function "public: virtual c
lass Blob __thiscall Handshake_client::process_data(class Blob const &)" (?proce
ss_data@Handshake_client@@UAE?AVBlob@@ABV2@@Z)
mysqlclient.lib(handshake.obj) : error LNK2019: unresolved external symbol _Comp
leteAuthToken@8 referenced in function "protected: bool __thiscall Handshake::pr
ocess_result(int)" (?process_result@Handshake@@IAE_NH@Z)
mysqlclient.lib(handshake.obj) : error LNK2019: unresolved external symbol _Free
ContextBuffer@4 referenced in function "public: void __thiscall Security_buffer:
:free(void)" (?free@Security_buffer@@QAEXXZ)
mysqlclient.lib(handshake.obj) : error LNK2019: unresolved external symbol _Acqu
ireCredentialsHandleA@36 referenced in function "public: __thiscall Handshake::H
andshake(char const *,enum Handshake::side_t)" (??0Handshake@@QAE@PBDW4side_t@0@
@Z)
mysqlclient.lib(handshake.obj) : error LNK2019: unresolved external symbol __imp
__DeleteSecurityContext@4 referenced in function "public: virtual __thiscall Han
dshake::~Handshake(void)" (??1Handshake@@UAE@XZ)
mysqlclient.lib(handshake.obj) : error LNK2019: unresolved external symbol __imp
__FreeCredentialsHandle@4 referenced in function "public: virtual __thiscall Han
dshake::~Handshake(void)" (??1Handshake@@UAE@XZ)
mysqlclient.lib(common.obj) : error LNK2019: unresolved external symbol _GetUser
NameExW@12 referenced in function "public: __thiscall UPN::UPN(void)" (??0UPN@@Q
AE@XZ)
blib\arch\auto\DBD\mysql\mysql.dll : fatal error LNK1120: 7 unresolved externals
NMAKE : fatal error U1077: 'C:\Perl\bin\perl.exe' : return code '0x1'
Stop.
CAPTTOFU/DBD-mysql-4.028.tar.gz
nmake -- NOT OK
答案 0 :(得分:0)
最后,我解决了。必须首先注意环境:Win8.1 + ActivePerl 5.16 + Mysql 5.5。
1)打开windows命令行,运行:
set path=%path%;D:\Program Files (x86)\MySQL\MySQL Server 5.5\bin
2)配置mysql数据库,添加一个UserName ='ODBC'的新用户,并将密码设置为NULL。
3)cd into:
D:\Program Files (x86)\MySQL\MySQL Server 5.5\lib
并将子目录创建为“opt”;
4)安装草莓perl,将libmysql.a和libmysql_.dll复制到
D:\Program Files (x86)\MySQL\MySQL Server 5.5\lib\opt;
5)卸载草莓;
6)set path =%path%; D:\ Program Files(x86)\ MySQL \ MySQL Server 5.5 \ lib \ opt
7)在同一命令行控制台中运行命令:
perl -MCPAN -e "install DBD::mysql"
现在一切都好。