Operating System - HP-UX
1825002 Members
2734 Online
109678 Solutions
New Discussion юеВ

DBD::MySql not installing right to perl on hpux.

 
SOLVED
Go to solution
Steve Post
Trusted Contributor

DBD::MySql not installing right to perl on hpux.

Simple question. It does not exactly fit the hp forums. But I find these forums the most responsive/intelligent than anything else I can find on the web. I just put this in the MySql forums. I don't know if I'll get an answer there.

ENOUGH RAMBLING. ONTO THE QUESTION......

I install perl from scratch without threads: DBD::MySql doesn't work.
I install perl from scratch with threads: DBD::MySql works.
I reinstall perl from scratch without threads: DBD::MySql fails.

I don't want to use threads. Perl's installation says to not use threads. Is there a way around it?

I have a sockets file. I would rather use this sockets file instead of a host:port method to connect to MySql. The word thread could have more than one meaning. I'm guessing that it is where I connect to MySql via an ip address and port. And I don't want to do that.

version stuff.
computer is an rp4440 running PA-RISC2.0
Operating System HPUX11.23
compiler gcc-4.0.2 (and I have gmake)
perl5.8.8 (without threaded option? with the threaded option?)
mysql5.0.26
PathTools-3.21
DBI-1.52
DBD::MySql-3.007

I could DUMP tons of info stuff here. But my question is pretty clear. Thread option required in building perl to use with mysql? Yes or No?

6 REPLIES 6
Steve Post
Trusted Contributor

Re: DBD::MySql not installing right to perl on hpux.

I guess I put in the wrong title. It should have been:

DBD:MySql requires threads in perl?

or

DBD:MySql can't use a /tmp/mysql_socket file?
H.Merijn Brand (procura
Honored Contributor
Solution

Re: DBD::MySql not installing right to perl on hpux.

You don't need a threaded perl to use threaded mysql I think. Same for Oracle.

You're probably just missing the thread libs in perl so dynamic load fails.

See the section on Oracle in README.hpux

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Steve Post
Trusted Contributor

Re: DBD::MySql not installing right to perl on hpux.

Thanks H.Merjin.

I don't seem to have the README file for oracle. I'll download the perl module again.

Since I have your ear.....

Is there some where that I can find a walk through on compiling and linking software in general? I seem to always have problems compiling things. I'd rather learn to fish, instead continually asking for fishes.
H.Merijn Brand (procura
Honored Contributor

Re: DBD::MySql not installing right to perl on hpux.

Good question. Sorry: no there is not.

GNU style:

# tar xzf dist-vsn.tar.gz
# cd dist-vsn
# cat INSTALL
# configure --help
# configure --prefix=/my/prefix --disable-nls ...
# make
# make check
# make install

Perl style

# perl -MCPAN -e'install New::Module'

or

# tar xzf module-vsn.tar.gz
# cd module-vsn
# perl Makefile.PL
# make
# make test
# make install

For most OpenSource software, there are the major files to start with: INSTALL* and README*
Some product come with prefabricated Makefiles, mostly prefab for GNU gcc that is :/
Some products/projects/packages come (god forbid) with Imakefiles and rely on imake.

Most GNU aware build processes allow you to use a file pointed to by the env variable $CONFIG_SITE (what a horrible name), which is a shell script that is called at some unclear point during configuration, but very helpful if you have more than one compiler to be used (g++ plus HP C-ANSI-C for example, as needed for groff).

The best manual however is experience :)
The best lead for fixing trouble is the ability to read warnings and error messages.

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
H.Merijn Brand (procura
Honored Contributor

Re: DBD::MySql not installing right to perl on hpux.

and I didn't refer to the DBD::Oracle README's, but to the core README's:

--8<--- README.hpux (or man perlhpux)
For building perl to support Oracle, it needs to be linked with libcl
and libpthread. So even if your perl is an unthreaded build, these
libraries might be required. See "Oracle on HP-UX" below.

:
:

=head2 Oracle on HP-UX

Using perl to connect to Oracle databases through DBI and DBD::Oracle
has caused a lot of people many headaches. Read README.hpux in the
DBD::Oracle for much more information. The reason to mention it here
is that Oracle requires a perl built with libcl and libpthread, the
latter even when perl is build without threads. Building perl using
all defaults, but still enabling to build DBD::Oracle later on can be
achieved using

Configure -A prepend:libswanted='cl pthread ' ...

Do not forget the space before the trailing quote.

Also note that this does not (yet) work with all configurations,
it is known to fail with 64-bit versions of GCC.
-->8---

I hope you know how to *keep* my attention :)

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Steve Post
Trusted Contributor

Re: DBD::MySql not installing right to perl on hpux.

Just wanted to say that I got it working. Thanks for the help. I might come back here and add the documentation.

The key was like you said. I updated file Config.sh
from: libs='-lnsl -lnm -lndbm -lmalloc -ldld -lm -lcrypt -lsec -lpthread -lc'libs='-lnsl -lnm -
to: lndbm -lmalloc -ldld -lm -lcrypt -lsec - -lc'

And when running the "perl Makefile.PL" for DBD-MySql-3.0007, I ran:
/opt/perl588/bin/perl ./Makefile.PL \
--cflags=" -I/opt/mysql-5.0.26/include/mysql" \
--libs=" -L/opt/mysql-5.0.26/lib/mysql \
-lmysqlclient -lz -lnsl -lm -lpthread -lc" \
--testdb="test" \
--testuser="testuser" \
--testpassword="password" \
--testhost="xyz" \
--testport="3310"

Even though perl was not setup to run threads, that "-lpthread" did the trick.
Also I see if I run mysqlhotcopy, there is an option to use sockets instead of a port.
./mysqlhotcopy -ubilly -ppassword --socket=/tmp/mysql1.socket

steve