![]() |
|< 1 2 >| | ![]() |
13 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
# Database administrative login by UNIX sockets
local all postgres ident sameuser
# TYPE DATABASE USER CIDR-ADDRESS METHOD
host all all
# "local" is for Unix domain socket connections only
local all all ident sameuser
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 md5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/perl
use warnings;
use strict;
use CGI;
use DBI;
my $zeile;
my $obj = new CGI;
open ( FH ,"</var/www/db/db.txt" ) or die "Kann Datei nicht oeffnen!\n";
my $db_name = <FH>;
my $db_user = <FH>;
my $db_passwd = <FH>;
close (FH);
chomp for $db_name, $db_user, $db_passwd;
my $dbh = DBI->connect ( "DBI:Pg:dbname=$db_name", "$db_user", "$db_passwd" )
or die "Keine Verbindung mit der DB!\n";
my $result = $dbh->prepare ( "SELECT * from kunden" ) or die "Vorbereitung nicht durchfuehrbar!\n";
$result->execute() or die "Abfrage nicht ausfuehrbar!\n";
print $obj->header ( "text/html" ),
$obj->start_html ( -title => "alle User" );
print $obj->h3 ( "Auflistung aller User \n" );
while ( $zeile = $result->fetchrow_arrayref )
{
print $obj->h4 ( "$zeile->[0] , $zeile->[1] , $zeile->[2] , $zeile->[3], $zeile->[4], $zeile->[5] \n" );
}
print $obj->end_html;
$dbh->disconnect();
exit;
Quote[Sun Jan 22 16:26:41 2006] [error] [client 127.0.0.1] Premature end of script headers: /usr/lib/cgi-bin/alle_user.pl
Quote[Sun Jan 22 16:18:56 2006] [error] [client 127.0.0.1] Premature end of script headers: /usr/lib/cgi-bin/alle_user.pl
DBI connect('dbname=test2','postgres',...) failed: FATAL: Ident-Authentifizierung für Benutzer »postgres« fehlgeschlagen
at /usr/lib/cgi-bin/alle_user.pl line 18
chomp for $db_name, $db_user, $db_passwd;
chomp($db_name, $db_user, $db_passwd);
1
2
my $dbh = DBI->connect ( "DBI:Pg:dbname=$db_name", "$db_user", "$db_passwd" )
or die "Keine Verbindung mit der DB!\n";
1
2
my $dbh = DBI->connect ("DBI:Pg:dbname=test2", "postgres", "sonderbar")
or die "Keine Verbindung mit der DB!\n";
QuoteFATAL: Ident-Authentifizierung für Benutzer »postgres« fehlgeschlagen
![]() |
|< 1 2 >| | ![]() |
13 Einträge, 2 Seiten |