Connect Amber to Postgress

I have a master password for pgadmin, but I don’t know of any other password.

I changed password to postgress, still doesn’t work

No idea what the issue is then.

  • Do you have a user with the username postgres or is it named something else?
  • Is it running on the correct port?

I don’t know I just installed it. I’d think everything would be default.

I purged and reinstalled Postges, now I get this:

no driver was registered for the schema "", did you maybe forget to require the database driver?

how do I set up a driver?

do I need to use a database shard? should I look at this?
https://crystal-lang.org/reference/database/

0.I run below in my Centos system not Ubuntu and works well:

1.If you had install Postgresql, you can try replace peer or ident in /var/lib/pgsql/data/pg_hba.conf to md5 and then restart Postgresql by sudo service postgresql restart. (postgresql - psql: FATAL: Ident authentication failed for user "postgres" - Stack Overflow).

2.If above still not work, try to modify password to ‘password’ by

$sudo -u postgres psql
could not change directory to "/home/myth/pet-tracker": Permission denied
psql (10.17)
Type "help" for help.

postgres=# ALTER USER postgres WITH PASSWORD 'password';
ALTER ROLE
postgres=# \q

To make sure database works, so can try this

su -  postgres 
psql -h localhost -p 5432 --username postgres  -d postgres -W # if type 'password' return no error, mean password had ok!

3.After above, then run

amber new pet-tracker
cd pet-tracker
amber g scaffold Pet name:string breed:string age:integer
amber db create migrate

as Getting Started - Amber Framework

That doesn’t sound like the error I get. I’ll share it when I’m back at my computer, but I think it just said connection fail, nothing about Ident .

I got the same connection fail when abmber db create, then I went to check by psql but get the Ident authentication failed, so I replaced peer or ident in pg_hba.conf to md5 and then restart Postgresql and abmber db create works.

If below code works, that means postgresql database connection is successful, and then go to try amber db create

su -  postgres 
psql -h localhost -p 5432 --username postgres  -d postgres -W # if type 'password' return no error, mean password had ok!

Is this in bash? The first row gives me

su: Authentication failure

I remember i got in before, so I’m not sure what to do.

psql -h localhost -p 5432 --username postgres  -d postgres -W # if type 'password' return no error, mean password had ok!

doesn’t give any errors, but

amber db create migrate

just says

Connection unsuccessful: postgres://postgres:password@localhost:5432/postgres

Had you try below to change password of user postgres ?

$sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'password';"

If so, then restart Postgresql by sudo service postgresql restart.

In my opinion, should make sure the password of user postgre is ‘password’ and then Amber can recognise it.

It works. For some reason I don’t have the amber logo, but the app itself works