Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-23 08:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found