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;