I decided to switch from MySQL to PostgreSQL recently, mostly just to learn a new DB. It was pretty painful, but I think I'm close.
I use php and PDO, my PDO driver has been successfully installed and configured.
Opening my site, I get an error message:
Connection failed: SQLSTATE[08006] [7] FATAL: Ident authentication failed for user "postgres"
I use the following connection calls (I tried several options for calling user / pw in the $ dsn variable and in the separate $ user / $ pass variables, including port = 5432):
$dsn = 'pgsql:dbname=db1;host=localhost;user=postgres;password=pass'; $db = new PDO($dsn);
Alternatively, I can enter my db from the command line:
$ su postgres
(pass)
$ psql db1
output:
failed to change directory to "/ home / ec2-user" psql (8.4.9) Type "help" for help.
DB1 = #
Any ideas? I would like to provide additional information if necessary.
source share