Perl 的 DBD::mysql -- 安装冲突

发布于 2024-10-19 06:18:45 字数 1228 浏览 3 评论 0原文

尝试在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

剩一世无双 2024-10-26 06:18:45

在其他平台上,构建过程运行 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 runs mysqladmin 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.

半葬歌 2024-10-26 06:18:45

继“Robert P”评论之后,我检查了 在 Win32 上的 ActivePerl 中安装 DBD::MySQL; 64,但似乎并不重要。

完成这项工作的命令是:

ppm install DBD::mysql

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:

ppm install DBD::mysql
东风软 2024-10-26 06:18:45

我过去解决这个问题的唯一方法是强制安装。总感觉像是一个困境,但我一直找不到更好的方法。

打开 CPAN shell:

perl -MCPAN -e 'shell'

然后执行强制安装

force install DBD::mysql

退出即可退出 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:

perl -MCPAN -e 'shell'

Then do a force install

force install DBD::mysql

quit gets you back out of the shell.

爱的故事 2024-10-26 06:18:45

正如 ysth 所说,也许尝试这个:

cd  C:\Perl\cpan\build\DBD-mysql-4.018-A

运行

perl Makefile.PL  --testuser validuser  --testpassword validpassword

然后尝试 make - make test - make install,
或 Windows 上的等效项

as ysth said , maybe try this :

cd  C:\Perl\cpan\build\DBD-mysql-4.018-A

and run

perl Makefile.PL  --testuser validuser  --testpassword validpassword

and then try to make - make test - make install,
or its equivalents on windows

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文