Just thought I would post this for the benefit of other monks since I was able to find a solution to my problem already.

I was setting up a web server on a Solaris 10 system using an in-house build of Perl and the MySQL binaries from sunfreeware.com (SMCmysql). It so happens that all the packages on sunfreeware.com are built in 32-bit mode, while our in-house Perl package is built in 64-bit mode. I really did not want to re-compile one or the other, although it looks at first like that is the only way around this problem.

My first crack at a solution was to uninstall SMCmysql and install instead the 64-bit binaries from MySQL AB's "community server" download site. With some foresight, I downloaded the same version from both sites (5.0.27). It seemed to work like a champ, although I did have to re-build the Makefile and get rid of the Sun-specific compiler and linker flags (more on this below).

Some weeks or months later, I needed to install PHP on the box, and the simplest solution for that was to install the sunfreeware.com PHP package. Of course, I then had to re-install SMCmysql, which broke the DBD::mysql module I'd so carefully built -- or so I thought. (Actually, in hindsight, that should have continued to work just fine if I'd left it alone, but the next time I tried to rebuild DBD::mysql it did in fact break.)

So I hit Google, and found the answer to making 64-bit Perl, sunfreeware.com's MySQL and DBD:mysql work and play together without re-compiling any packages other than DBD::mysql itself. Here's how:

  1. When you go get SMCmysql from sunfreeware.com, also download the 64-bit MySQL binaries for that version from MySQL AB.
  2. Install SMCmysql in the usual place. Install the other package (named simply "mysql") in an alternate location, say "/root" (using pkgadd -R /root). It will not install completely; that's OK. Add the binary directory thus created (/root/opt/mysql/mysql/bin, don't ask me why) to root's PATH.
  3. Install DBI and DBD::mysql from CPAN.
  4. The latter install will almost certainly fail if you're using gcc, because MySQL AB use the Sun compilers. To get around this, change directory to the newest .cpan/build/DBD-mysql* directory, gather only the -I argument from cflags and the -L and -l arguments from libs in the output of mysql_config (which should be on the screen from the failed build), and feed them to MakeMaker like so: perl Makefile.PL --cflags="I/..." --libs="-L/... -lmysqlclient ...". Then do a make install.
  5. Once you have installed DBD::mysql you can remove the extra binaries with pkgrm -R /root mysql.

Hope this helps.


In reply to Interfacing 64-bit Perl with 32-bit MySQL from sunfreeware.com on Solaris by bigmacbear

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.