On Wednesday, October 23, 2002, at 10:54 PM, Jonathan Baumgartner wrote:

I am unable to install DBD::mysql via CPAN successfully.
I did this recently, and I found that DBD::mysql is one of those rare modules that needs a bit more hand-holding than CPAN can provide automatically.

Can't exec "mysql_config": No such file or directory at Makefile.PL line 169.
Make sure that the mysql_config tool is in your path.

I'd guess that you installed MySQL via Fink, and then added the Fink startup script to your login script. But, when you 'su - root' to run cpan, you're using *root*'s environment, not that of your "normal" account, so /sw/bin/ isn't in your path any more. That's what happened to me the first time I tried to install it. :-)

mysql is running, but root has a password associated with it. I imagine this is why the tests are failing. How do I get around this?
In cpan, do a "look DBD::mysql" to have it download the module, unpack it for you, and open up a shell prompt in the correct directory. (Even when it can't compile a module, cpan is still useful for *something*.) Then, configure the module manually, passing a few options to Makefile.PL:

perl Makefile.PL --testdb=test --testuser= --testpassword=

The above will tell it to run its tests against the 'test' database, using anonymous access with no password. If you'd like to use a different database, user, or password, just change those options as appropriate. If you'd like for it to run its tests against a remote database, you can also use the "--testhost" and/or "--testport" options.

From here on out, the usual "make; make test; make install" dance should work. You could also exit the subshell that cpan opened up for you, and run "install DBD::mysql". Once you've run Makefile.PL, cpan should be able to see that, and run the build, test, and install steps without re-running it.

sherm--


If you listen to a UNIX shell, can you hear the C?



Reply via email to