I installed Postgres with this command
sudo apt-get install postgresql postgresql-client postgresql-contrib libpq-dev
Using psql --version
on terminal I get psql (PostgreSQL) 9.3.4
then I installed pgadmin
with
sudo apt-get install pgadmin3
Later I opened the UI and create the server with this information
but this error appear
how can I fix it?
This question is related to
postgresql
database-connection
pgadmin
First you should change the password using terminal. (username is postgres)
postgres=# \password postgres
Then you will be prompted to enter the password and confirm it.
Now you will be able to connect using pgadmin with the new password.
Create a user first. You must do this as user postgres. Because the postgres system account has no password assigned, you can either set a password first, or you go like this:
sudo /bin/bash
# you should be root now
su postgres
# you are postgres now
createuser --interactive
and the programm will prompt you.
Modify password for role postgres:
sudo -u postgres psql postgres
alter user postgres with password 'postgres';
Now connect to pgadmin using username postgres and password postgres
Now you can create roles & databases using pgAdmin
if you open the psql
console in a terminal window, by typing
$ psql
you're super user username will be shown before the =#
, for example:
elisechant=#
$
That will be the user name you should use for localhost.
It helps me:
pg_hba.conf
sudo nano /etc/postgresql/9.x/main/pg_hba.conf
and change this line:
Database administrative login by Unix domain socket
local all postgres md5
to
Database administrative login by Unix domain socket
local all postgres trust
Restart the server
sudo service postgresql restart
Login into psql and set password
psql -U postgres
ALTER USER postgres with password 'new password';
pg_hba.conf
and change this line: Database administrative login by Unix domain socket local all postgres trust
to
Database administrative login by Unix domain socket local all postgres md5
sudo service postgresql restart
Source: Stackoverflow.com