[SL] Re: Install probs-FreeBSD

Nop. The error he is getting is related to DBI, has nothing to do with 
the version of SL.

When these things happen, it is necessary to check things by layer.

1) The PostgreSql installation: 
1a) Check that you can login the psql tool into template1 as the  
postgres user. Check again to see if user sql-ledger can login. 
1b) Check your authentication setup. See if you are using 
authentication on the local host and if so, can you login psql with 
this command: psql -U sql-ledger template1   ... If you created sql-
ledger without a password and _afterwards_  you modify your 
pg_hba.conf file for authentication you will never be able to login. 
You must set you pg_hba.conf file back, restart the postmaster and 
enter as postgres. Then you must issue an ALTER USER (see the postgres 
doc) to change, or rather add a password. Remember to do the same to 
the postgres user which I have never figured out what his default 
password is (if any). Rememeber that every time you modify you conf 
files for postgres you must restart you rpostmaster (in 
Debain /etc/init.d/postgres restart).
1c) Finally, see if you are using Unix sockets or TCP/IP for your 
postmaster (see the postgres doc, it's very complete). Hint: 
postmaster -i
2) Check for DBI and DBD Pg workings. If you installed these packages 
yourself, the packages include self tests. If you did not (RPM, DPKG, 
etc.) I would suggest you write a small perl script that uses DBI and 
connects to the database: here is such a script (please check it as I 
writing it by heart, but it should be OK):

-------------------- SCRIPT START ---------------------------

#!/usr/bin/perl

use DBI;

$database="template1";
$user="your-favorite-user";
$password="foo";

# WITH AUTHENTICATION
$dbh = DBI->connect("DBI:Pg:$database", $user, $password)
        or die "Can't connect $dbh->errstr\n";

# WITHOUT AUTHENTICATION
#$dbh = DBI->connect("DBI:Pg:dbname=$database", $user)
        or die "Can't connect $dbh->errstr\n";

$query= "select relname from pg_class";
$sth = $dbh->prepare($query)
        or die "Can't prepare $query: $dbh->errstr\n";
$rv = $sth->execute
        or die "Can't execute $query: $sth->errstr";

#actually if it got this far the rest is not needed but what the 
heck...
if($sth->rows > 0){
        print "It Worked!";
}
else{
        print "Something is wrong!";
}

-------------------- SCRIPT END -----------------------------


3) If you got this far the you know the database, communications and 
the DBI/DBD::Pg layer are working. Now you must go on to check for the 
HTTP Server configuration. I've only used Apache but in escence the 
important things here is to make sure that: a) you have permission to 
execute, b) you have a virtual directory [not a must but neat], c) 
that the http sevre can follow symbolic links [this _is_ a must for 
the 'official' installation but if you are working in a hosted 
environment I can teach you a workaround for this].

From here on, you can blame the problems on SL, the versions, etc..


Regards,
Alejandro



> 
> ons, 2003-05-21 kl. 23:54 skrev Dave Aas:
> > <snip>
> 
> > n I do so, I get the following error message in
> > my browser:
> > 
> > Error!
> > No Database Drivers available!
> > 
> > What am I doing wrong? Did I install the wrong ports?
> > 
> Which version of sql-ledger. I have the same problem with RH 9.0 and
> sql-ledger 2.0.6. I asked for help a fourthnigth ago at this list. I
> have a running version 2.0.5 at another machine running RH 9.0. This
> morning I just checked the difference in packages, and the only
> difference are that sql-ledger has been upgraded to ver 2.0.6.
> 
> I'm afraid that the Database error is something that has been 
introduced
> to version 2.0.6, but I haven't got the time to downgrade to ver. 
2.0.5
> just to see.
> 
> > Any help would be appreciated. Thanks.
> > 
> > Dave Aas
> > daveaas(at)srt(dot)com
> -- 
> Christian Treldal <chris@xxxxxxxxxxxxxxxx>
> 
> 
> 
> 

-- 
Alejandro Imass

Other related posts: