J
Justin Catterall
I have the following code to connect to a database:
#!/usr/bin/perl
use warnings ;
use strict ;
use DBIx::Simple ;
use SQL::Abstract ;
use CGI qw/:standard/ ;
use CGI::Carp qw/fatalsToBrowser/ ;
my $dataSource ;
db_connect() ;
print "Connected\n";
sub db_connect {
my $user = "name" ;
my $password = "password" ;
my $dataSource = DBIx::Simple->connect(
'dbig:database=prospects', $user, $password,
{ RaiseError => 1 , AutoCommit => 0 }
) or die DBI::Simple->error ;
}
If I run this from the command line "Connected" gets printed. If I run
it from a browser I get:
DBI connect('database=prospects','justin',...) failed: FATAL: Ident
authentication failed for user "justin" at
/var/www/inhouse/prospects/demo.cgi line 22
Does anyone know why this should be?
Thank you for your comments and suggestions.
#!/usr/bin/perl
use warnings ;
use strict ;
use DBIx::Simple ;
use SQL::Abstract ;
use CGI qw/:standard/ ;
use CGI::Carp qw/fatalsToBrowser/ ;
my $dataSource ;
db_connect() ;
print "Connected\n";
sub db_connect {
my $user = "name" ;
my $password = "password" ;
my $dataSource = DBIx::Simple->connect(
'dbig:database=prospects', $user, $password,
{ RaiseError => 1 , AutoCommit => 0 }
) or die DBI::Simple->error ;
}
If I run this from the command line "Connected" gets printed. If I run
it from a browser I get:
DBI connect('database=prospects','justin',...) failed: FATAL: Ident
authentication failed for user "justin" at
/var/www/inhouse/prospects/demo.cgi line 22
Does anyone know why this should be?
Thank you for your comments and suggestions.