Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## pg_hba.conf
- # "local" is for Unix domain socket connections only
- local all all ident
- # IPv4 local connections:
- host all all 127.0.0.1/32 ident
- # IPv6 local connections:
- host all all ::1/128 ident
- host all user 10.240.217.103/8 md5
- ## postgresql.conf
- listen_addresses = '*' # what IP address(es) to listen on;
- # comma-separated list of addresses;
- # defaults to 'localhost', '*' = all
- # (change requires restart)
- port = 5432 # (change requires restart)
- max_connections = 100 # (change requires restart)
- ## attempt to connect on the command line
- [root@ec2-184-73-145-17 php]# su - postgres
- -bash-3.2$ psql forums -l bbadmin -p secret
- psql: could not connect to server: No such file or directory
- Is the server running locally and accepting
- connections on Unix domain socket "/tmp/.s.PGSQL.0"?
- ## attempt to connect via script
- [root@ec2-184-73-145-17 php]# php connect.php
- PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: Ident authentication failed for user "bbadmin" in /home/bluethundr/php/connect.php on line 2
- ## php connect script
- [root@ec2-184-73-145-17 php]# cat connect.php
- <?php
- $dbconn = pg_connect("host=localhost port=5432 user=bbadmin dbname=forums password=secret");
- ?>
Add Comment
Please, Sign In to add comment