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"
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are two methods you can use. Both require creating a user and a database.
By default psql connects to the database with the same name as the user. So there is a convention to make that the “user’s database”. And there is no reason to break that convention if your user only needs one database. We’ll be using
mydatabaseas the example database name.Using createuser and createdb, we can be explicit about the database name,
You should probably be omitting that entirely and letting all the commands default to the user’s name instead.
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
postgresuser,Or,
Sidenote: the
postgresuserI suggest NOT modifying the
postgresuser.postgres. You’re supposed to have root to get to authenticate aspostgres.postgreswhich 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.