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

I have been going round-and-a-round for about 24 hrs trying to setup an AMD64 system running Solaris 10 11/06

FYI:
Installed Solaris 10 11/06 from DVD
Installed SunStudio 11 from DVD
Spent hours installing patches from Sun

Installed from source using gcc the following:

Perl5.8.8
MySQL 5.0.45
Apache2
Data-Dumper-2.121
Data-ShowTable-3.3
DBI-1.58


Perl and MySQL seemed to install and run just fine however when I went to install DBD::MySQL things went bad fast.

I have tried installing the following different items with no success.

mysql-connector-odbc-3.51.19-solaris10-x86-32bit.pkg

Msql-Mysql-modules-1.2219

When I do:

pkgadd -d mysql-connector-odbc-3.51.19-solaris10-x86-32bit.pkg

I get the following error:

Installing MySQL Connector/ODBC (GPL) as <myodbc3>

## Installing part 1 of 1.
verifying class <none>
## Executing postinstall script.
ld.so.1: myodbc3i: fatal: libodbcinst.so.1: open failed: No such file or directory
Killed
ERROR: Could not register the driver. Please make sure you have the driver manager "unixODBC"
installed before you install this package
pkgadd: ERROR: postinstall script did not complete successfully

Installation of <myodbc3> failed.

ls -l /usr/local/lib/libodbcinst* showes the following

-rwxr-xr-x 1 root root 821 Aug 22 07:55 /usr/local/lib/libodbcinst.la
lrwxrwxrwx 1 root root 20 Aug 22 07:55 /usr/local/lib/libodbcinst.so -> libodbcinst.so.1.0.0
lrwxrwxrwx 1 root root 20 Aug 22 07:55 /usr/local/lib/libodbcinst.so.1 -> libodbcinst.so.1.0.0
-rwxr-xr-x 1 root root 289856 Aug 22 07:55 /usr/local/lib/libodbcinst.so.1.0.0

I then tried to compile and install Msql-Mysql-modules-1.2219

When I ran make I received the following error(s)

gcc -c -I/usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris/auto/DBI -I/usr/local/mysql/include/mysql -I../dbd -I/usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris/auto/DBI -I/usr/local/lib/perl5/5.8.8/i86pc-solaris -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -O -DVERSION=\"2.0419\" -DXS_VERSION=\"2.0419\" -fPIC "-I/usr/local/lib/perl5/5.8.8/i86pc-solaris/CORE" -DDBD_MYSQL mysql.c
mysql.xs: In function `XS_DBD__mysql__dr__ListDBs':
mysql.xs:98: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
mysql.xs: In function `XS_DBD__mysql__dr__admin_internal':
mysql.xs:138: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
mysql.xs:144: error: too few arguments to function `mysql_shutdown'
mysql.xs:186: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
mysql.xs: In function `XS_DBD__mysql__db__ListDBs':
mysql.xs:250: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
mysql.xs: In function `XS_DBD__mysql__db__ListTables':
mysql.xs:271: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
*** Error code 1

make: Fatal error: Command failed for target `mysql.o'

Current working directory /src/Msql-Mysql-modules-1.2219/mysql
*** Error code 1
The following command caused the error:
cd mysql && make -f Makefile all LIBPERL_A="libperl.a" LINKTYPE="dynamic" OPTIMIZE="-O" PREFIX="/usr/local"
make: Fatal error: Command failed for target `subdirs'

I then tried to compile and install Msql-Mysql-modules-1.2219

When I ran make I received the following error(s)

gcc -c -I/usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris/auto/DBI -I/usr/local/mysql/include/mysql -I../dbd -I/usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris/auto/DBI -I/usr/local/lib/perl5/5.8.8/i86pc-solaris -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -O -DVERSION=\"2.0419\" -DXS_VERSION=\"2.0419\" -fPIC "-I/usr/local/lib/perl5/5.8.8/i86pc-solaris/CORE" -DDBD_MYSQL mysql.c
mysql.xs: In function `XS_DBD__mysql__dr__ListDBs':
mysql.xs:98: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
mysql.xs: In function `XS_DBD__mysql__dr__admin_internal':
mysql.xs:138: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
mysql.xs:144: error: too few arguments to function `mysql_shutdown'
mysql.xs:186: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
mysql.xs: In function `XS_DBD__mysql__db__ListDBs':
mysql.xs:250: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
mysql.xs: In function `XS_DBD__mysql__db__ListTables':
mysql.xs:271: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type

*** Error code 1
make: Fatal error: Command failed for target `mysql.o'
Current working directory /src/Msql-Mysql-modules-1.2219/mysql
*** Error code 1

The following command caused the error:
cd mysql && make -f Makefile all LIBPERL_A="libperl.a" LINKTYPE="dynamic" OPTIMIZE="-O" PREFIX="/usr/local"

make: Fatal error: Command failed for target `subdirs'


Trying to install from CPAN was no better.

I could really use some assistance in solving this/my problem.

Replies are listed 'Best First'.
Re: DBD::MySQL Install Problem
by Joost (Canon) on Aug 22, 2007 at 14:33 UTC
      I had already downloaded DBD-mysql-4.005 from CPAN and it failed complaining about it could not find mysql_config file.

      However I tried again but this time I put the mysql_config from the mysql source directory into the DBD-mysql-4.005 directory.

      Running perl Makefile.PL produces the following:

      I will use the following settings for compiling and testing:

      cflags (mysql_config) = -I/usr/local/mysql/include/mysql
      embedded (mysql_config) =
      libs (mysql_config) =
      -L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lposix4 -lresolv -lgen -lsocket -lnsl -lm
      mysql_config (guessed ) = mysql_config
      nocatchstderr (default ) = 0
      nofoundrows (default ) = 0
      ssl (guessed ) = 0
      testdb (default ) = test
      testhost (default ) =
      testpassword (default ) =
      testsocket (default ) =
      testuser (default ) =

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

      Using DBI 1.58 (for perl 5.008008 on i86pc-solaris) installed in /usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris/auto/DBI/ Writing Makefile for DBD::mysql

      I then ran make which produced the following:

      gcc -c -I/usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris/auto/DBI -I/usr/local/mysql/include/mysql -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -O -DVERSION=\"4.005\" -DXS_VERSION=\"4.005\" -fPIC "-I/usr/local/lib/perl5/5.8.8/i86pc-solaris/CORE" dbdimp.c gcc -c -I/usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris/auto/DBI -I/usr/local/mysql/include/mysql -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -O -DVERSION=\"4.005\" -DXS_VERSION=\"4.005\" -fPIC "-I/usr/local/lib/perl5/5.8.8/i86pc-solaris/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/mysql/lib/mysql:/usr/lib" /usr/local/bin/perl myld gcc -G dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.so \ -L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lposix4 -lresolv -lgen -lsocket -lnsl -lm \
      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/DBD::mysql.3
      Manifying blib/man3/DBD::mysql::INSTALL.3
      Manifying blib/man3/Bundle::DBD::mysql.3

      I then ran 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.8/i86pc-solaris/auto/DBD/mysql/.packlist
      Appending installation info to /usr/local/lib/perl5/5.8.8/i86pc-solaris/perllocal.pod

      So I thought things were going well until I ran a test script that uses DBI which produced the following error:

      install_driver(mysql) failed: Can't load '/usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris/auto/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: perl: fatal: libmysqlclient.so.15: open failed: No such file or directory at /usr/local/lib/perl5/5.8.8/i86pc-solaris/DynaLoader.pm line 230.

      at (eval 3) line 3
      Compilation failed in require at (eval 3) line 3.
      Perhaps a required shared library or dll isn't installed where expected
      at test.pl line 7
      It looks like it can't load / find the libs.

      I am running out of steam and getting very frustraded with myself. I hope that you can provide solution so that I can get past the install and start having some fun with it.
        Unless you've specifically build mysql without the client libraries that would probably work.

        But maybe the mysql_config program you've provided does not point to the right locations. (by the way, installing mysql should install mysql_config, that directory might not be in your path - it could be installed in /usr/sbin or /usr/local/bin for instance)

        what does

        mysql_config --libs
        print?

        Mine (on linux) gives

        -L/usr/lib/mysql -lmysqlclient
        Which means that libmysqlclient.so* should be installed in /usr/lib/mysql. Which is correct for my system.

        install_driver(mysql) failed: Can't load '/usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris/auto/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: perl: fatal: libmysqlclient.so.15: open failed: No such file or directory at /usr/local/lib/perl5/5.8.8/i86pc-solaris/DynaLoader.pm line 230.
        You need to install the MySQL client libraries, which you can find here: MySQL downloads

        Just reread your thread, where you said that you'd compiled MySQL from source, in which case you should already have the client libraries. So ignore the above. What about trying the MySQL prebuilt packages instead?

        Clint