Showing posts with label dbd. Show all posts
Showing posts with label dbd. Show all posts

Thursday, October 16, 2008

MySQL DBD in Activestate

I'm currently doing some consulting work to bridge the gap between Oracle and MySQL. Being in a Windows environment, I'm using the Activestate Perl distribution. Fortunately, it includes a nice ODBC module for connecting to Oracle out of the box. The bad news is, it doesn't contain a MySQL module. Luckily, I found a third party host that does provide the module. The following ppm (Perl Package Manager) one-liner takes care of the issue.

C:\>ppm install http://cpan.uwinnipeg.ca/PPMPackages/10xx/DBD-mysql.ppd

Thursday, August 21, 2008

Installing Ruby DBI, MySQL on Centos 5.2

There's no good documentation on how to do this online, so here's a quick tutorial on how to get Ruby's DBI and MySQL packages installed on CentOS 5.2. There aren't any pre-packaged binaries for this, so building from scratch is pretty much your only option.

# download
wget http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.7.tar.gz

# extract
tar zxvf mysql-ruby-2.7.tar.gz

# change dir
cd mysql-ruby-2.7

# configure (requires mysql development package AND gcc)
ruby extconf.rb --with-mysql-config
checking for mysql_ssl_set()... yes
checking for mysql.h... yes
creating Makefile

# finish (as root)
make install
(ignore warnings)

Now DBI:

# download
wget http://rubyforge.org/frs/download.php/41303/dbi-0.2.2.tar.gz

# extract
tar zxvf dbi-0.2.2.tar.gz

# change dir
cd dbi-0.2.2

# setup
ruby setup.rb config --with=dbi,dbd_mysql
ruby setup.rb setup

# finish (as root)
ruby setup.rb install