Perl 的 DBD::mysql -- 安装冲突
尝试在 Windows 7 上安装 Perl 模块 DBD::mysql
从 Windows 命令行我执行了
perl -MCPAN -e 'install DBD::mysql'
下载并解压缩文件的操作 - 然后给了我这个错误:
CPAN.pm: Going to build C/CA/CAPTTOFU/DBD-mysql-4.018.tar.gz
Set up gcc environment - 3.4.5 (mingw-vista special r3)
C:\PROGRA~1\MySQL\MYSQLS~1.1\bin\MYSQLA~1.EXE: connect to server at 'localhost'
failed
error: 'Access denied for user 'ODBC'@'localhost' (using password: NO)'
Problem running C:\PROGRA~1\MySQL\MYSQLS~1.1\bin\MYSQLA~1.EXE - aborting ...
Warning: No success on command[C:\Perl\bin\perl.exe Makefile.PL INSTALLDIRS=site
]
问题是MySQL的root用户有密码,但不清楚我如何解决这个问题。
问题、反馈、请求——只需评论,谢谢!
<强>---------- 更新(1): RE:强制安装 DBD::mysql
cpan> force install DBD::mysql
Running install for module 'DBD::mysql'
Running make for C/CA/CAPTTOFU/DBD-mysql-4.018.tar.gz
Has already been unwrapped into directory C:\Perl\cpan\build\DBD-mysql-4.018-A
1T8Uh
'C:\Perl\bin\perl.exe Makefile.PL INSTALLDIRS=site' returned status 256, won't
make
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Attempting to install the Perl module DBD::mysql
on Windows 7
From the Windows command line I executed
perl -MCPAN -e 'install DBD::mysql'
Which downloaded and uncompressed the file -- then gave me this ERROR:
CPAN.pm: Going to build C/CA/CAPTTOFU/DBD-mysql-4.018.tar.gz
Set up gcc environment - 3.4.5 (mingw-vista special r3)
C:\PROGRA~1\MySQL\MYSQLS~1.1\bin\MYSQLA~1.EXE: connect to server at 'localhost'
failed
error: 'Access denied for user 'ODBC'@'localhost' (using password: NO)'
Problem running C:\PROGRA~1\MySQL\MYSQLS~1.1\bin\MYSQLA~1.EXE - aborting ...
Warning: No success on command[C:\Perl\bin\perl.exe Makefile.PL INSTALLDIRS=site
]
Guessing the issue is that MySQL's root user has a password, but what's not clear is how I resolve the issue.
Questions, feedback, requests -- just comment, thanks!!
----------
UPDATE (1): RE: force install DBD::mysql
cpan> force install DBD::mysql
Running install for module 'DBD::mysql'
Running make for C/CA/CAPTTOFU/DBD-mysql-4.018.tar.gz
Has already been unwrapped into directory C:\Perl\cpan\build\DBD-mysql-4.018-A
1T8Uh
'C:\Perl\bin\perl.exe Makefile.PL INSTALLDIRS=site' returned status 256, won't
make
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在其他平台上,构建过程运行 mysql_config 命令来获取有关 mysql 安装的必要信息,无需用户名和密码;在 win32 上,如果您有 mysql_config 命令,则必须使用
--mysql_config yourpathname
参数显式告知 Makefile.PL。如果没有,它会查找 mysqladmin 程序并使用其位置来尽可能确定,但运行 mysqladmin version 来获取 mysql 版本。您可以使用 Makefile.PL 的 --testuser 和 --testpassword 参数提供用户/密码,以便能够执行此操作。On other platforms, the build process runs the mysql_config command to get necessary information about the mysql installation without need of a user and password; on win32, if you have a mysql_config command, you have to explicitly tell Makefile.PL about it with a
--mysql_config yourpathname
parameter. If you don't, it looks for the mysqladmin program and uses its location to determine as much as it can but runsmysqladmin version
to get the mysql version. You can provide a user/password for it to be able to do this using --testuser and --testpassword parameters to Makefile.PL.继“Robert P”评论之后,我检查了 在 Win32 上的 ActivePerl 中安装 DBD::MySQL; 64,但似乎并不重要。
完成这项工作的命令是:
Following up on "Robert P" comment, I checked the install guide for installing DBD::MySQL in ActivePerl on Win32; on 64, but doesn't appear to have mattered.
Command that did the job was:
我过去解决这个问题的唯一方法是强制安装。总感觉像是一个困境,但我一直找不到更好的方法。
打开 CPAN shell:
然后执行强制安装
退出即可退出 shell。
The only way I've got round this in the past is a forced install. It always feels like a bodge but I haven't been able to find a better way.
Open up a CPAN shell:
Then do a force install
quit gets you back out of the shell.
正如 ysth 所说,也许尝试这个:
运行
然后尝试 make - make test - make install,
或 Windows 上的等效项
as ysth said , maybe try this :
and run
and then try to make - make test - make install,
or its equivalents on windows