Did a new install of postgres 8.4 on mint ubuntu. How do I create a user for postgres and login using psql?
When I type psql, it just tells me
psql: FATAL: Ident authentication failed for user "my-ubuntu-username"
Did a new install of postgres 8.4 on mint ubuntu. How do I create a user for postgres and login using psql?
When I type psql, it just tells me
psql: FATAL: Ident authentication failed for user "my-ubuntu-username"
you can also connect to database as "normal" user (not postgres):
There are two methods you can use. Both require creating a user and a database.
Using createuser and createdb,
Using the SQL administration commands, and connecting with a password over TCP
And, then in the psql shell
Then you can login,
If you don't know the port, you can always get it by running the following, as the
postgres
user,Or,
Sidenote: the
postgres
userI suggest NOT modifying the
postgres
user.postgres
. You're supposed to have root to get to authenticate aspostgres
.postgres
which is the PostgreSQL equivalent of SQL Server'sSA
, you have to have write-access to the underlying data files. And, that means that you could normally wreck havoc anyway.The error your are getting is because your-ubuntu-username is not a valid Postgres user.
You need to tell psql what database username to use
You may also need to specify the database to connect to
by default you would need to use the postgres user:
If your database client connects with TCP/IP and you have ident auth configured in your pg_hba.conf check that you have an identd installed and running. This is mandatory even if you have only local clients connecting to "localhost".
Also beware that nowadays the identd may have to be IPv6 enabled for Postgresql to welcome clients which connect to localhost.