Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

prob with DBD::mysql on Mac OS X

by zetetes (Pilgrim)
on Jan 02, 2004 at 15:43 UTC ( [id://318334]=perlquestion: print w/replies, xml ) Need Help??

zetetes has asked for the wisdom of the Perl Monks concerning the following question:

i tried to install the DBI-module on my powerbook (mac os 10.3). but run into problems with the DBD::mysql-module. actually, the install went ok. but now i try to connect to a db and get these errors in the error_log:
/.../auto/DBD/mysql/mysql.bundle undefined reference to _mysql_real_co +nnect expected to be defined in a dynamic image /.../auto/DBD/mysql/mysql.bundle undefined reference to _mysql_real_es +cape_string expected to be defined in a dynamic image /.../auto/DBD/mysql/mysql.bundle undefined reference to _mysql_real_qu +ery expected to be defined in a dynamic image /.../auto/DBD/mysql/mysql.bundle undefined reference to _mysql_refresh + expected to be defined in a dynamic image /.../auto/DBD/mysql/mysql.bundle undefined reference to _mysql_shutdow +n expected to be defined in a dynamic image /.../auto/DBD/mysql/mysql.bundle undefined reference to _mysql_stat ex +pected to be defined in a dynamic image /.../auto/DBD/mysql/mysql.bundle undefined reference to _mysql_store_r +esult expected to be defined in a dynamic image /.../auto/DBD/mysql/mysql.bundle undefined reference to _mysql_thread_ +id expected to be defined in a dynamic image /../auto/DBD/mysql/mysql.bundle undefined reference to _mysql_use_resu +lt expected to be defined in a dynamic image
i tried for hours to get it running but now i don't have any clue what i could do next... maybe one of you has? mysql is set up and running. thanks!

Replies are listed 'Best First'.
Re: prob with DBD::mysql on Mac OS X
by stvn (Monsignor) on Jan 03, 2004 at 01:49 UTC

    I personally have never encountered this problem (I too have a powerbook w/10.3 and MySQL on it). My best guess is that the mysql-client libraries are either not installed, or that DBD::mysql cannot find them.

    Try adding the mysql /bin directory to your path, this might fix the problem. I know in my MySQL installation the path is:

    /Library/MySQL/bin
    But that might not be the same for you, all depends upon how you installed MySQL.

    -stvn
Re: prob with DBD::mysql on Mac OS X
by neuroball (Pilgrim) on Jan 03, 2004 at 05:51 UTC
    Hm,

    it seems that there are some parts missing. So I will go down a checklist here:

    • Did you install the following Distributions?
      • Bundle::DBI
      • Bundle::DBD::mysql

    If not, please give it a try. This distros worked yet every time for me. Even cross-platform.

    /oliver/

      Okay, I re-investigated the problem after it did also show up in one of my mailing lists... and after around 1h or searching on google and bash scripting, I arrived at the following solution.

      it seems that perl can't access some library functions that it needs. Meaning: It doesn't have access to the mysql libraries and/or includes.

      • You might want to do the following:
      • Search for MYSQL, e.g.:
        • sudo find / mysql | grep mysql
      • Depending on where mysql is installed, you get one location for the main file returned. E.g.:
        • /usr/mysql
      • Now... take a look at your PATH, e.g.:
        • set | grep PATH
      • Are the directories for the mysql main directory included in the PATH?
        If not you have two choices:
        1. add the mysql main directory to the path
          • PATH=$PATH:/usr/mysql
        2. add INCLUDE and LIBRARY tags for mysql
          • export MYSQL_INCLUDE="/usr/mysql/include"
          • export MYSQL_LIBRARY="/usr/mysql/lib"

      Hope this helps.

      /oliver/

      Update: Added <code> tags around the "two choices" code snippets.

        Also look @ Net::MySql module for machines which don't have a mysql client installed....
        thanks for your research! sounds reasonable to me. but, it does not work anyway...
        a few more questions you can easily answer me:
        - i do not have to restart the system do i?
        - my mysql is in /usr/local/mysql..../. i tried with the alias (which is /usr/local/mysql) and with the whole path. neither worked. maybe it helps to reinstall mysql to /usr/mysql?

        i tried both ways, the PATH and the export. keep on trying. thanks for your help & patience!
Re: prob with DBD::mysql on Mac OS X
by zetetes (Pilgrim) on Mar 19, 2004 at 14:46 UTC
    uh. finally i found the time to care about this old prob. and finally i found a way getting this child walking (how do you say in english?).

    - i removed mysql completely and set it up new. (as described here.) i'm not sure, whether this was needed at all.
    - next i manually installed DBI
    - next, and maybe most important step, i did not fetch DBD but the whole msql-mysql-modules-1.2219-package. i did it manually also, but did not have any difficulties with makefile, make, make test, make install.

    that's it. now it's up and running smoothly. very nice.
    thanks guys for your (mental) support.
      After many frustrating failures at installing DBD::mysql on my mac OS 10.3, I just performed the third of the 3 mentioned steps (that is, installing "msql-mysql-modules-1.2219") and bingo! First time! ++ to zetetes! Thank you!

      Update: Just found this piece by Googling:
      Should you need to install DBD::mysql on Panther, here's a few tips yo +u might find helpful. First: DBD::mysql installation will likely fail + if you try to do it using the CPAN installer because it won't be con +figured with your database settings. You'll need to manually install +it. Get it from CPAN here: DBD-mysql-2.9003 . To create the Makefile you'll need to pass it your database's username + and password: perl Makefile.PL --testuser=usename --testpassword=password Next you'll need to add the following step (thanks to Casey West): perl -pi -e's/MACOSX/env MACOSX/' Makefile I also had to sudo make install which makes the whole process like so: perl Makefile.PL --testuser=username --testpassword=password perl -pi -e's/MACOSX/env MACOSX/' Makefile make make test sudo make install

      —Brad
      "Don't ever take a fence down until you know the reason it was put up. " G. K. Chesterton
Re: prob with DBD::mysql on Mac OS X
by Your Mother (Archbishop) on Jul 22, 2004 at 08:58 UTC

    I had the same problem every time I upgraded and I resorted force ("force install" from the CPAN shell). I don't recommend it but I've had no problems either with mysql 3 or 4 after installing the DBD(s) that way. I'm still on 10.2.8 for the Mac though.

Re: prob with DBD::mysql on Mac OS X
by ChemBoy (Priest) on Jan 08, 2004 at 01:26 UTC

    I was so unsucessful in getting DBD::mysql to work that I just punted and went with DBD::mysqlPP. I think it comes bundled with DBD::mysql, but you'll have to hand-install the files owing to a brain-dead makefile. It does, however, work once you get it installed (or at least, it works for me, with Perl 5.8.1 and OS X 10.2).



    If God had meant us to fly, he would *never* have given us the railroads.
        --Michael Flanders

      thank you guys for your help.
      it seems i got yet another prob (cpan fails to make 'test'). so after trying to re-install perl i'm stuck with something like this.

      oh well. i just keep on trying, which is hard and nervwrecking since i do not have much of a clue... but that's life, isn't it? :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://318334]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-25 12:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found