Installing DBI and DBD::mysql on debian 7

This docs describes the installation and configuration of DBD::mysql, the Perl DBI (database interface) driver for the MySQL database. It is used to connect perl scripts to mysql database and perform operations. The modules can be downloaded from http://search.cpan.org/ i.e. DBI and DBD::mysql. Manual installation illustrated below.

The build-essential packages are required. If not available install using the command apt-get install build-essential.

DBI Manual Installation

root@debian1:/opt# tar -zxvf DBI-1.631.tar.gz
root@debian1:/opt# cd DBI-1.631/
root@debian1:/opt/DBI-1.631# perl Makefile.PL
root@debian1:/opt/DBI-1.631# make
root@debian1:/opt/DBI-1.631# make install

DBD::MySQL manual Installation

root@debian1:/opt# tar -zxvf DBD-mysql-4.026.tar.gz
root@debian1:/opt# cd DBD-mysql-4.026/
root@debian1:/opt/DBD-mysql-4.026# perl Makefile.PL  --mysql_config=/usr/local/mysql/bin/mysql_config  --with-mysql=/usr/local/mysql
root@debian1:/opt/DBD-mysql-4.026# make
root@debian1:/opt/DBD-mysql-4.026# make install

Verify the modules are installed properly

root@debian1:/opt/DBI-1.631# perl -e 'use DBI'
root@debian1:/opt/DBD-mysql-4.026# perl -e 'use DBD::mysql'

The output of the above command should be bank, means installed properly.

 

 

Add new comment