PostreSQL: problem with empty password

postgresql

#1

Hello there,

im trying to build up my database test on CircleCI and im stuck for more than 3 hours.

Stiuation:

id like to run on postgresql database on PHP application , but as far as i get is getting error fe_sendauth: no password supplied because ubuntu user has not set any password.

I already tried:

  • by postgres command line:

  • creating new user and add privilegies (permission denied)

  • set ubuntu user some password (permissing denied)

is there any possibilities to be allowed changing own password in box? Or may I connect to postgres by socket not by TCP connection to localhost? Or is there any other way?

Thanks


#2

Are you able to try these steps using sudo?


#3

Hello is not permitted by database not by system, so sudo cannot helps am I right?


#4

So I think that the default user ubuntu is created as a superuser, is that who you are connecting to the DB with?

Also:

  1. Is this a public project?
  2. Which version of PSQL are you using?

#5

Aah, im little bit further, thanks for giving right question

problem was here:

psql -c 'ALTER USER ubuntu with password 'test';' -U ubuntu;
ERROR:  syntax error at or near "test"

but now im in funny situation.

  1. if I alter user password, postgre says ALTER but i can still log in in ssh like psql -U ubuntu without asking any password
  2. If i want to create new user like this:
  - psql -c "CREATE user test with password 'test'";
  - psql -c "GRANT ALL PRIVILEGES ON DATABASE circle_test to test;";

I can loggin in ssh with psql -U test and providing password, but test still fails on:

  Doctrine\DBAL\Exception\ConnectionException: An exception occured in driver: SQLSTATE[08006] [7] FATAL:  password authentication failed for user "test"

and to your questions:

  1. is not but there is my circle.yml:
machine:

  timezone:
    Europe/Berlin

  php:
    version:
      5.6.14

  services:
    - redis
    - postgresql

dependencies:
  pre:
    - psql -c "CREATE user test with password 'test'";
    - psql -c "GRANT ALL PRIVILEGES ON DATABASE circle_test to test;";
    - composer install --dev --prefer-source --no-interaction
    - mv ./tests/config/config.local.neon ./tests/config/config.developers.neon
    - mv ./tests/config/config.circle.neon ./tests/config/config.local.neon

test:
  override:
    - ./vendor/bin/tester tests/
  1. as you can see i use default version of postgres on your servers.

Thanks for help.


How do I connect to the host postgres service from the docker container under test
#6