Installing DBD::mysql on Mac OS 10.6.3 Snow Leopard

2010-04-07 Thread Bobby
Hello,
I am very new to the DBI module.  I am trying to connect to a
mysql installation on a server over the internet, however I cannot get
the DBD::mysql driver installed properly.  When I try to install via
CPAN with the command 'sudo -H cpan -i DBD::mysql'  I get the error:

CPAN: Storable loaded ok (v2.18)
Going to read /var/root/.cpan/Metadata
  Database was generated on Tue, 06 Apr 2010 13:34:47 GMT
CPAN: YAML loaded ok (v0.71)
Going to read /var/root/.cpan/build/
DONE
Found 16 old builds, restored the state of 16
Running install for module 'DBD::mysql'
Running make for C/CA/CAPTTOFU/DBD-mysql-4.013.tar.gz
  Has already been unwrapped into directory /var/root/.cpan/build/DBD-
mysql-4.013-CoqaqX
  '/usr/bin/perl Makefile.PL' returned status 512, won't make
Running make test
  Make had some problems, won't test
Running make install
  Make had some problems, won't install


Has anybody encountered this and know a workaround?  I could not get a
manual install to work either, although I will admit I don't have any
previous experience doing a manual install.  I tried to follow the
instructions on the DBD::mysql module page have been reading this
group and searching for solutions online but nothing has worked.  When
I try a manual install i get the message:

PLEASE NOTE:

For 'make test' to run properly, you must ensure that the
database user 'robertmulley' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.

mysql grant all privileges on test.* to 'robertmulley'@'localhost'
identified by 's3kr1t';

You can also optionally set the user to run 'make test' with:

perl Makefile.pl --testuser=username

Can't exec mysql_config: No such file or directory at Makefile.PL
line 464.
Can't find mysql_config. Use --mysql_config option to specify where
mysql_config is located
Can't exec mysql_config: No such file or directory at Makefile.PL
line 464.
Can't find mysql_config. Use --mysql_config option to specify where
mysql_config is located
Can't exec mysql_config: No such file or directory at Makefile.PL
line 464.
Can't find mysql_config. Use --mysql_config option to specify where
mysql_config is located
Failed to determine directory of mysql.h. Use

  perl Makefile.PL --cflags=-Idir

to set this directory. For details see the INSTALL.html file,
section C Compiler flags or type

  perl Makefile.PL --help




I have MAMP installed and running.  Also I don't care about connecting
to localhost, is there a way to run the drop table tests ect on a
server over the internet? Thanks.



Re: Installing DBD::mysql on Mac OS 10.6.3 Snow Leopard

2010-04-07 Thread Michael Ludwig
Am 06.04.2010 um 17:14 schrieb Bobby:

 Hello,
I am very new to the DBI module.  I am trying to connect to a
 mysql installation on a server over the internet, however I cannot get
 the DBD::mysql driver installed properly.

You need a libmysqlclient on your local machine. One way to get one is to 
install the server.

Are you using Darwin Ports [1]? Might be easier. That would allow you to just 
do:

port install p5-dbd-mysql

[1] http://darwinports.com/

  When I try to install via
 CPAN with the command 'sudo -H cpan -i DBD::mysql'  I get the error:

  '/usr/bin/perl Makefile.PL' returned status 512, won't make

This seems to indicate that you've encountered errors on a previous run, and 
the logic decides it doesn't want to run against the wall a second time.

 Can't exec mysql_config: No such file or directory at Makefile.PL
 line 464.

It looks like you either don't have an installation of MySQL, or it is not in 
your PATH.

 I have MAMP installed and running.  Also I don't care about connecting
 to localhost, is there a way to run the drop table tests ect on a
 server over the internet? Thanks.

So MAMP may be installed and running, but your Perl doesn't seem to know about 
it. You should get connections to localhost to work, else why have you 
installed MAMP in the first place?

-- 
Michael.Ludwig (#) XING.com



Re: Installing DBD::mysql on Mac OS 10.6.3 Snow Leopard

2010-04-07 Thread Bruce Johnson


On Apr 6, 2010, at 8:14 AM, Bobby wrote:



I have MAMP installed and running.  Also I don't care about connecting
to localhost, is there a way to run the drop table tests ect on a
server over the internet? Thanks.


If you have MAMP running, the perl in OS X doesn't know about it. So  
when you run the cpan command to install the DBD-MYSQL it's failing  
because it can't find MySQL.


MAMP runs everything (Perl, MySQL, Apache, PHP, etc) WITHIN the MAMP  
App.


IF you want to run MySQL with the default Perl and apache, etc in OS  
X, you need to let OS X know where stuff is.


The simplest way to get MySQL working properly with the local perl, in  
my experience, is to use MacPorts
http://www.macports.org/ (used to be DarwinPorts), and make sure  
the /opt/... paths are in your ENV.




--
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group

Institutions do not have opinions, merely customs