blunders
blunders

Reputation: 3669

Perl's DBD::mysql -- installation conflict

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

Upvotes: 1

Views: 6860

Answers (4)

blunders
blunders

Reputation: 3669

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

Upvotes: 2

knb
knb

Reputation: 9313

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

Upvotes: 1

ysth
ysth

Reputation: 98398

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.

Upvotes: 2

Martin Steel
Martin Steel

Reputation: 582

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.

Upvotes: 1

Related Questions