A cheat sheet for installing DBD and DBI to run sql-bench for MySQL intended for novices since there is not much material on the net that is simple and works!

1. Download the latest DBI and DBD modules from the net.

2.  Make sure that the mysql access works:

 mysql -S /tmp/mysql.sock -ruoot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 240 to server version: 5.1.38-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

3.  Verify your PATH env variable - it should include Sun Studio Compiler path for cc.

 PATH=/usr/local/bin:/usr/bin:/usr/sbin:/usr/sfw/bin/:/usr/ccs/bin:<SS>/bin

4. Decompress the DBI tar bundle to a temp location say /tmp.

 5. Order of execution:

 a) perl Makefile.PL

 b) make

c) make test

d) make install

6. Now decompress DBD and execute:

a) perl Makefile.PL

b) make

c) make test

** I faced some errors which I chose to ignore.

d) make install

Some of problems I faced were:

**If I used 32 bit perl downloaded from freeware site, it was by default using gcc shipped in /usr/sfw/bin as the compiler and that resulted in :

bash-3.00# make
gcc -c  -I/usr/local/lib/perl5/site_perl/5.8.8/sun4-solaris/auto/DBI -I/usr/sfw/include/mysql -xstrconst -mt -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -I/opt/gnu/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O    -DVERSION=\"4.012\"  -DXS_VERSION=\"4.012\" -fPIC "-I/usr/local/lib/perl5/5.8.8/sun4-solaris/CORE"   dbdimp.c
gcc: language strconst not recognized
gcc: dbdimp.c: linker input file unused because linking not done
gcc -c  -I/usr/local/lib/perl5/site_perl/5.8.8/sun4-solaris/auto/DBI -I/usr/sfw/include/mysql -xstrconst -mt -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -I/opt/gnu/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O    -DVERSION=\"4.012\"  -DXS_VERSION=\"4.012\" -fPIC "-I/usr/local/lib/perl5/5.8.8/sun4-solaris/CORE"   mysql.c
gcc: language strconst not recognized
gcc: mysql.c: linker input file unused because linking not done
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/usr/sfw/lib:/usr/lib" /usr/local/bin/perl myld gcc  -G -L/usr/local/lib -L/opt/gnu/lib dbdimp.o  mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so    \
   -R/usr/sfw/lib -R/usr/sfw/lib/mysql -L/usr/sfw/lib -L/usr/sfw/lib/mysql -lmysqlclient -lz -lposix4 -lcrypt -lgen -lsocket -lnsl -lm          \

gcc: dbdimp.o: No such file or directory
gcc: mysql.o: No such file or directory
*** Error code 1
make: Fatal error: Command failed for target `blib/arch/auto/DBD/mysql/mysql.so'

**If you are using perl shipped with solaris, you automatically get the error that cc is not found.

 ** If the all the libraries are using /usr/local/mysql and if the path doesn't exist, the compilation will fail!

I wish I could provide more updates as I fiddle around with it!

Comments:

Thank you very much..

Posted by Sesli Chat on September 10, 2009 at 02:26 AM IST #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by maddy