DBD::mysql installation problems

2003-06-05 Thread Nathan Relevy
Title: Message



I had the same 
problem as nemesis, and I'd like to ADD my sincere thanks to 
both nemesis and John Tobin for offering a 
solution to a problem that troubled me too.

If I ever meet 
either of you too, you're due a beer on me too!!!


Kind regards, Nathan Relevy 


DBD::mysql installation problems redux

2002-09-24 Thread jonah

Hello everyone, sorry to bother you all with this, I try to keep my head
down most of the time, but I'm in a bit of a pinch here.

My chum Graham is trying to install DBD::mysql on his Solaris 5.6 box at
my request, but is having trouble. It's failing at the make stage, and he
can't figure out why. I'm none the wiser since he's a lot cleverer than I
am (that's not saying much) and I don't do a lot of make-ing anyway,
preferring to let CPAN do all that. Anybody got any suggestions?

Many heartfelt thanks in advance.

Here's some Info:

perl -v returns This is perl, v5.8.0 built for sun4-solaris
Solaris version 5.6
mysqld is definitely running on localhost since we can connect to it fine
with the mysql command line client and from elsewhere, too.

Here's our problem:

# perl Makefile.PL --cflags=-I'/usr/local/mysql/include'
--libs=-L/usr/local/my
qlclient -lz -lcrypt -lgen -lsocket -lnsl -lm --testdb=test
--testuser=dummy   
I will use the following settings for compiling and testing:

  cflags(Users choice) = -I/usr/local/mysql/include 
  libs  (Users choice) = -L/usr/local/myqlclient -lz -lcrypt -lgen
-lsocket -lnsl -lm   
  nocatchstderr (default ) = 0  
  ssl   (guessed ) = 0  
  testdb(Users choice) = test   
  testhost  (default ) =
  testpassword  (default ) =
  testuser  (Users choice) = dummy  

To change these settings, see 'perl Makefile.PL --help' and 
'perldoc INSTALL'.  

Using DBI 1.30 installed in
/usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/auto/DBI 
 
Writing Makefile for DBD::mysql 
# make  
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm   
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod 
cp lib/Mysql.pm blib/lib/Mysql.pm   
cp lib/Mysql/Statement.pm blib/lib/Mysql/Statement.pm   
cp lib/DBD/mysql.pod blib/lib/DBD/mysql.pod 
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm 
gcc -B/usr/ccs/bin/ -c
-I/usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/auto
/DBI -I/usr/local/mysql/include  -fno-strict-aliasing -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -O-DVERSION=\2.1019\  -DXS_VERSION=\2.1019\ -fPIC
-I/usr/local/lib/perl5/5.8.0/sun4-solaris/CORE   dbdimp.c  
dbdimp.c: In function `mysql_dr_connect':   
dbdimp.c:632: `MYSQL_OPT_COMPRESS' undeclared (first use in this function)  
dbdimp.c:632: (Each undeclared identifier is reported only once 
dbdimp.c:632: for each function it appears in.) 
dbdimp.c:641: `MYSQL_OPT_CONNECT_TIMEOUT' undeclared (first use in this
function)  
 
dbdimp.c:652: `MYSQL_READ_DEFAULT_FILE' undeclared (first use in this
function) 
dbdimp.c:662: `MYSQL_READ_DEFAULT_GROUP' undeclared (first use in this
function)
dbdimp.c:714: warning: passing arg 5 of `mysql_real_connect' makes integer
from pointer without a cast  
dbdimp.c:714: warning: passing arg 6 of `mysql_real_connect' makes pointer
from integer without a cast  
dbdimp.c:714: warning: passing arg 7 of `mysql_real_connect' makes integer
from pointer without a cast  
dbdimp.c:714: too many arguments to function `mysql_real_connect'   
dbdimp.c: At top level: 
dbdimp.c:1102: parse error before `val' 
dbdimp.c: In function `my_ulonglong2str':   
dbdimp.c:1103: `val' undeclared (first use in this function)
dbdimp.c: In function `mysql_st_fetch': 
dbdimp.c:1508: warning: assignment from incompatible pointer type   
gcc: file path prefix 

Re: DBD::mysql installation problems redux

2002-09-24 Thread Nicholas Clark

On Tue, Sep 24, 2002 at 07:40:30AM -0700, jonah wrote:
 perl -v returns This is perl, v5.8.0 built for sun4-solaris
 Solaris version 5.6
 mysqld is definitely running on localhost since we can connect to it fine
 with the mysql command line client and from elsewhere, too.

Did you download a binary perl, or build it yourself from source?
What does

  perl -V:cc 

say?

 dbdimp.c: In function `mysql_dr_connect':
 dbdimp.c:632: `MYSQL_OPT_COMPRESS' undeclared (first use in this function)
 dbdimp.c:632: (Each undeclared identifier is reported only once
 dbdimp.c:632: for each function it appears in.)
 dbdimp.c:641: `MYSQL_OPT_CONNECT_TIMEOUT' undeclared (first use in this
 function)
 dbdimp.c:652: `MYSQL_READ_DEFAULT_FILE' undeclared (first use in this
 function)
 dbdimp.c:662: `MYSQL_READ_DEFAULT_GROUP' undeclared (first use in this
 function)
 dbdimp.c:714: warning: passing arg 5 of `mysql_real_connect' makes integer
 from pointer without a cast
 dbdimp.c:714: warning: passing arg 6 of `mysql_real_connect' makes pointer
 from integer without a cast
 dbdimp.c:714: warning: passing arg 7 of `mysql_real_connect' makes integer
 from pointer without a cast
 dbdimp.c:714: too many arguments to function `mysql_real_connect'
 dbdimp.c: At top level:
 dbdimp.c:1102: parse error before `val'
 dbdimp.c: In function `my_ulonglong2str':
 dbdimp.c:1103: `val' undeclared (first use in this function)
 dbdimp.c: In function `mysql_st_fetch':
 dbdimp.c:1508: warning: assignment from incompatible pointer type
 gcc: file path prefix `/usr/ccs/bin/' never used
 *** Error code 1
 make: Fatal error: Command failed for target `dbdimp.o'

This all looks consistent with a single header file failing to be included.
That would explain both the missing macro definitions, and what appears to
be an error relating to prototypes (probably return types from functions
defaulting to int)

could you send a copy of line 714 of dbdimp.c please? [to see if that guess
is correct]

Nicholas Clark




Re: DBD::mysql installation problems redux

2002-09-24 Thread jonah

On Tue, 24 Sep 2002, Nicholas Clark wrote:

 Did you download a binary perl, or build it yourself from source?

Apparently it was a binary perl.

   perl -V:cc 
cc='gcc -B/usr/ccs/bin/';
 
 could you send a copy of line 714 of dbdimp.c please? [to see if that guess
 is correct]

Well, I have three of those, so here they are:

from Mysql-modules/DBD-mysql/dbdimp.c
 FreeParam(imp_sth-params, DBIc_NUM_PARAMS(imp_sth));

from Mysql-modules/dbd/dbdimp.c
 if (dbis-debug = 2) {

   (I imagine that's not the dbdimp.c you were looking for)

from Mysql-modules/DBD-mSQL/dbdimp.c
 FreeParam(imp_sth-params, DBIc_NUM_PARAMS(imp_sth));

Gratitude.

-- 
matt
I fucking hate pie.






Re: DBD::mysql installation problems redux

2002-09-24 Thread Nicholas Clark

On Tue, Sep 24, 2002 at 08:06:59AM -0700, jonah wrote:
 On Tue, 24 Sep 2002, Nicholas Clark wrote:
 
  Did you download a binary perl, or build it yourself from source?
 
 Apparently it was a binary perl.
 
perl -V:cc 
 cc='gcc -B/usr/ccs/bin/';
  
  could you send a copy of line 714 of dbdimp.c please? [to see if that guess
  is correct]
 
 Well, I have three of those, so here they are:
 
 from Mysql-modules/DBD-mysql/dbdimp.c
  FreeParam(imp_sth-params, DBIc_NUM_PARAMS(imp_sth));
 
 from Mysql-modules/dbd/dbdimp.c
  if (dbis-debug = 2) {
 
(I imagine that's not the dbdimp.c you were looking for)
 
 from Mysql-modules/DBD-mSQL/dbdimp.c
  FreeParam(imp_sth-params, DBIc_NUM_PARAMS(imp_sth));

Well, which was in the directory where the C compiler's error was generated
from? (Your make output with the error messages doesn't make it clear which
if any of these directories was the current directory at the time of the
errors)

But even if I know that, nothing obvious springs out, and I'm now stuck.

I'd suggest that you send the make output and the output of perl -V
(capital V - it's verbose but useful) to whatever the official DBD mysql
list is, as they may have seen this sort of build problem before.

Sorry I can't help further

Nicholas Clark




Re: DBD::mysql installation problems redux

2002-09-24 Thread nemesis

Nicholas Clark wrote:
 On Tue, Sep 24, 2002 at 08:06:59AM -0700, jonah wrote:
 
On Tue, 24 Sep 2002, Nicholas Clark wrote:


Did you download a binary perl, or build it yourself from source?

Apparently it was a binary perl.

Was it a binary or source installation of mysql?  I seem to remember 
having similar problems with a DBD::mysql installation and I think 
installing a source version of mysql cured the problem.  It was a long 
time ago though so my memory is pretty hazy, I don't know if this will 
solve the problem.

Will.





DBD::mysql installation problems

2002-09-21 Thread nemesis

Hi All,

I have set up a new machine (to replace a crusty old server) but I am 
having a few problems installing DBD::mysql which I need for a few apps 
on the box.  I installed MySQL 3.23.52 in /usr/local/mysql, not 
/usr/local and this seemed to cause CPAN to fail when installing 
DBD::mysql so I tried installing it manually.  Here is what I did.

# cd /root/.cpan/sources/authors/id/J/JW/JWIED/DBD-mysql-2.1019

The values for --cflags and --libs in the next step were taken from 
using the commands:

# /usr/local/mysql/bin/mysql_config --cflags
# /usr/local/mysql/bin/mysql_config --libs

Now I ran the command:

# perl Makefile.PL --cflags=-I/usr/local/mysql/include/mysql 
--libs=-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm

which produced the following output:


Unknown option: lmysqlclient
Unknown option: lz
Unknown option: lcrypt
Unknown option: lnsl
Unknown option: lm
Can't exec mysql_config: No such file or directory at Makefile.PL line 
169.
readline() on closed filehandle PIPE at Makefile.PL line 171.
Can't exec mysql_config: No such file or directory at Makefile.PL line 
169.
readline() on closed filehandle PIPE at Makefile.PL line 171.
Can't exec mysql_config: No such file or directory at Makefile.PL line 
169.
readline() on closed filehandle PIPE at Makefile.PL line 171.
Can't exec mysql_config: No such file or directory at Makefile.PL line 
169.
readline() on closed filehandle PIPE at Makefile.PL line 171.
Can't exec mysql_config: No such file or directory at Makefile.PL line 
169.
readline() on closed filehandle PIPE at Makefile.PL line 171.
Can't exec mysql_config: No such file or directory at Makefile.PL line 
169.
readline() on closed filehandle PIPE at Makefile.PL line 171.
I will use the following settings for compiling and testing:

   cflags(Users choice) = -I/usr/local/mysql/include/mysql
   libs  (Users choice) = -L/usr/local/mysql/lib/mysql
   nocatchstderr (default ) = 0
   ssl   (guessed ) = 0
   testdb(default ) = test
   testhost  (default ) =
   testpassword  (default ) =
   testuser  (default ) =

To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.

Checking if your kit is complete...
Looks good
Using DBI 1.30 installed in 
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/DBI
Writing Makefile for DBD::mysql


Then a make and make install:


# make
cc -c  -I/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/DBI 
-I/usr/local/mysql/include/mysql -fno-strict-aliasing 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 
-DVERSION=\2.1019\ -DXS_VERSION=\2.1019\ -fpic 
-I/usr/local/lib/perl5/5.8.0/i686-linux/CORE   dbdimp.c
cc -c  -I/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/DBI 
-I/usr/local/mysql/include/mysql -fno-strict-aliasing 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 
-DVERSION=\2.1019\ -DXS_VERSION=\2.1019\ -fpic 
-I/usr/local/lib/perl5/5.8.0/i686-linux/CORE   mysql.c
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH= /usr/local/bin/perl myld cc  -shared -L/usr/local/lib 
dbdimp.o mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so
chmod 755 blib/arch/auto/DBD/mysql/mysql.so
cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs
chmod 644 blib/arch/auto/DBD/mysql/mysql.bs
Manifying blib/man3/Mysql.3
Manifying blib/man3/DBD::mysql::INSTALL.3
Manifying blib/man3/DBD::mysql.3
Manifying blib/man3/Bundle::DBD::mysql.3



# make install
Files found in blib/arch: installing files in blib/lib into architecture 
dependent library tree
Writing 
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/DBD/mysql/.packlist
Appending installation info to 
/usr/local/lib/perl5/5.8.0/i686-linux/perllocal.pod


Now when I run a program that uses DBD::mysql I get the error:

/usr/bin/perl: error while loading shared libraries: 
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/DBD/mysql/mysql.so: 
undefined symbol: mysql_init

and I am completely stumped, what have I done wrong here?  Is this an 
installation problem, or a problem with the versions of MySQL and 
DYD::mysql I am using?

TIA,
Will.





Re: DBD::mysql installation problems

2002-09-21 Thread John Tobin

On Sat, Sep 21, 2002 at 01:15:45PM +0100, nemesis wrote:
 Now I ran the command:
 
 # perl Makefile.PL --cflags=-I/usr/local/mysql/include/mysql 
 --libs=-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm

I think you need to put quotes around your --libs argument to stop
your shell splitting it on spaces, i.e.
--libs=-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm

 which produced the following output:
 
 
 Unknown option: lmysqlclient
 Unknown option: lz
 Unknown option: lcrypt
 Unknown option: lnsl
 Unknown option: lm

This looks like your --libs argument has been split by your shell, so
Makefile.PL is receiving six arguments instead of one.

 Now when I run a program that uses DBD::mysql I get the error:
 
 /usr/bin/perl: error while loading shared libraries: 
 /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/DBD/mysql/mysql.so: 
 undefined symbol: mysql_init

That's probably because the mysql libraries (-lmysqlclient) were not
linked in earlier.

 and I am completely stumped, what have I done wrong here?  Is this an 
 installation problem, or a problem with the versions of MySQL and 
 DYD::mysql I am using?

An installation problem I think.

 TIA,
 Will.

Hope this helps.

-- 
John
[Parrot] will have reflection, introspection, and Deep Meditative
Capabilities.
Dan Sugalski, 2002/07/11, [EMAIL PROTECTED]