Howto install DBD-mysql on Mac OS X - Solution

M

Martin Kissner

Hello together,

this time I am not going txpo post a Question but a solution to a - as
far as I know common - problem.

Installation of DBD-mysql has been a problem on Mac OS X 10.3 and still
is on Mac OS X 10.4.

As far as I have experienced at least one problem is that mysql_config
does not provide correct settings for cflags and libs directories, which
actually is an error of mysql and not of Perl.
It can be solved by editing "/usr/local/mysql/bin/mysql_config" and
changing the following lines:

pkglibdir='/usr/local/mysql/lib/mysql'
to
pkglibdir='/usr/local/mysql/lib/'
and
pkgincludedir='/usr/local/mysql/include/mysql'
to
pkgincludedir='/usr/local/mysql/include/'

It is also possible to leave mysql_config alone and to call "perl
Makefile.PL" as follows (all in one line and with a space before the
second and thid line), but I prefere the first method:

perl Makefile.PL --cflags="-I/usr/local/mysql/include/
-fno-omit-frame-pointer" --libs="-L/usr/local/mysql/lib/ -lmysqlclient
-lz -lm"

I have tested both methods on Mac OS X 10.4 and hope that this will be
useful to others.

Best regards
Martin
 
I

ioneabu

Martin said:
Hello together,

this time I am not going txpo post a Question but a solution to a - as
far as I know common - problem.

Installation of DBD-mysql has been a problem on Mac OS X 10.3 and still
is on Mac OS X 10.4.

As far as I have experienced at least one problem is that mysql_config
does not provide correct settings for cflags and libs directories, which
actually is an error of mysql and not of Perl.
It can be solved by editing "/usr/local/mysql/bin/mysql_config" and
changing the following lines:

pkglibdir='/usr/local/mysql/lib/mysql'
to
pkglibdir='/usr/local/mysql/lib/'
and
pkgincludedir='/usr/local/mysql/include/mysql'
to
pkgincludedir='/usr/local/mysql/include/'

It is also possible to leave mysql_config alone and to call "perl
Makefile.PL" as follows (all in one line and with a space before the
second and thid line), but I prefere the first method:

perl Makefile.PL --cflags="-I/usr/local/mysql/include/
-fno-omit-frame-pointer" --libs="-L/usr/local/mysql/lib/ -lmysqlclient
-lz -lm"

I have tested both methods on Mac OS X 10.4 and hope that this will be
useful to others.

Best regards
Martin

I had no problem with installing DBD-mysql. What version of MySQL did
you use? I put the current autoinstall for OS X in my system (10.3 and
now 10.4) and had no problem. Maybe they fixed it?
 
M

Martin Kissner

I had no problem with installing DBD-mysql. What version of MySQL did
you use? I put the current autoinstall for OS X in my system (10.3 and
now 10.4) and had no problem. Maybe they fixed it?

MySQL version 4.1.11 installed with the package installer by
http://dev.mysql.com/downloads/mysql/4.1.html (Standard) on
Mac OS X 10.4

I had the same trouble with 4.0.23 on Mac OS X 10.3.

Surprisingly I didn't have the problem on my iBook but only on my G4
Sawtooth.

I'd ask you a favour:
Could you please post the output of
mysql_config
in Terminal?

Thanks in advance and
Best regards
Martin
 
M

Martin Kissner

I had no problem with installing DBD-mysql. What version of MySQL did
you use? I put the current autoinstall for OS X in my system (10.3 and
now 10.4) and had no problem. Maybe they fixed it?

MySQL version 4.1.11 installed with the package installer by
http://dev.mysql.com/downloads/mysql/4.1.html (Standard) on
Mac OS X 10.4

I had the same trouble with 4.0.23 on Mac OS X 10.3.

Surprisingly I didn't have the problem on my iBook but only on my G4
Sawtooth (at least under 10.3).

I'd ask you a favour:
Could you please post the output of
mysql_config
in Terminal?

Thanks in advance and
Best regards
Martin
 
I

ioneabu

Martin said:
MySQL version 4.1.11 installed with the package installer by
http://dev.mysql.com/downloads/mysql/4.1.html (Standard) on
Mac OS X 10.4

I had the same trouble with 4.0.23 on Mac OS X 10.3.

Surprisingly I didn't have the problem on my iBook but only on my G4
Sawtooth (at least under 10.3).

I'd ask you a favour:
Could you please post the output of
mysql_config
in Terminal?

Usage: ./mysql_config [OPTIONS]
Options:
--cflags [-I/usr/local/mysql/include
-fno-omit-frame-pointer]
--include [-I/usr/local/mysql/include]
--libs [-L/usr/local/mysql/lib -lmysqlclient -lz -lm]
--libs_r [-L/usr/local/mysql/lib -lmysqlclient_r -lz
-lm]
--socket [/tmp/mysql.sock]
--port [3306]
--version [4.1.10a]
--libmysqld-libs [-L/usr/local/mysql/lib -lmysqld -lm]
 
M

Martin Kissner

Martin said:
I'd ask you a favour:
Could you please post the output of
mysql_config
in Terminal?

Usage: ./mysql_config [OPTIONS]
Options:
--cflags [-I/usr/local/mysql/include
-fno-omit-frame-pointer]
--include [-I/usr/local/mysql/include]
--libs [-L/usr/local/mysql/lib -lmysqlclient -lz -lm]
--libs_r [-L/usr/local/mysql/lib -lmysqlclient_r -lz
-lm]
--socket [/tmp/mysql.sock]
--port [3306]
--version [4.1.10a]
--libmysqld-libs [-L/usr/local/mysql/lib -lmysqld -lm]

Thank you very much.
On you Installation the pathes are correct.
Did you also download a dmg-file and install with a *.pkg installer?
 
I

ioneabu

Martin said:
Martin said:
I'd ask you a favour:
Could you please post the output of
mysql_config
in Terminal?

Usage: ./mysql_config [OPTIONS]
Options:
--cflags [-I/usr/local/mysql/include
-fno-omit-frame-pointer]
--include [-I/usr/local/mysql/include]
--libs [-L/usr/local/mysql/lib -lmysqlclient -lz -lm]
--libs_r [-L/usr/local/mysql/lib -lmysqlclient_r -lz
-lm]
--socket [/tmp/mysql.sock]
--port [3306]
--version [4.1.10a]
--libmysqld-libs [-L/usr/local/mysql/lib -lmysqld -lm]

Thank you very much.
On you Installation the pathes are correct.
Did you also download a dmg-file and install with a *.pkg installer?

exactly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top