Re: Need help getting DBI to work under mod_perl

[prev] [thread] [next] [Date index for 2005/02/06]

From: jonathan vanasco
Subject: Re: Need help getting DBI to work under mod_perl
Date: 14:43 on 06 Feb 2005
On Feb 6, 2005, at 1:09 AM, Boysenberry Payne wrote:
> I running Mac OS X darwin, and get everything as showing correctly in 
> the %ENV.
> my $dsn = "DBI:mysql:database=test";
> my $test_db = eval{ DBI->connect( $dsn, "...", "...", { RaiseError => 
> 1, PrintError => 1, AutoCommit => 1 } ) };

first off, i'd double check that you can connect to the db test with 
the values '...' for user and pass that you substituted '...' with  
above

forever, i've used the same simple chunk of code, which has worked fine 
under osx + mod_perl
it gives me a db object that holds all of the db handles i  need (so i 
can create sep. handles for a write master or read slaves), and i just 
access everything through there per project

it generally looks like this
===========================================================
package my::DB;
use DBI;
my  $DB 		= 'dbi:mysql:test';
my  $DBuser 	= 'test';
my  $DBpass 	= 'test';
sub new
{
	my  $proto = shift;
	my  $class = ref($proto) || $proto;
	my  $this  = bless ( {} , $class);
		$this->dbconnect;
	return $this;
}
sub dbconnect
{
   my  $this = $_[0];
   $this->{'DBH'} = DBI->connect( $DB, $DBuser, $DBpass );
   if (!defined $this->{'DBH'} )
   {
     print STDERR "Cannot connect to sql server !";
   }
   print STDERR "CONNECTING VIA $DB DB \n";
}
1;

Need help getting DBI to work under mod_perl
Boysenberry Payne 06:09 on 06 Feb 2005

Re: Need help getting DBI to work under mod_perl
Boysenberry Payne 06:32 on 06 Feb 2005

Re: Need help getting DBI to work under mod_perl
Jay Scherrer 17:46 on 06 Feb 2005

Re: Need help getting DBI to work under mod_perl
Boysenberry Payne 22:16 on 06 Feb 2005

Re: Need help getting DBI to work under mod_perl
Boysenberry Payne 21:54 on 07 Feb 2005

Re: Need help getting DBI to work under mod_perl
Boysenberry Payne 18:46 on 06 Feb 2005

Re: Need help getting DBI to work under mod_perl
jonathan vanasco 14:43 on 06 Feb 2005

Generated at 21:37 on 09 Feb 2005 by mariachi v0.52