Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 587153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:10:57+00:00 2026-05-13T15:10:57+00:00

Did a new install of postgres 8.4 on mint ubuntu. How do I create

  • 0

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"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:10:58+00:00Added an answer on May 13, 2026 at 3:10 pm

    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 mydatabase as the example database name.

    1. Using createuser and createdb, we can be explicit about the database name,

      $ sudo -u postgres createuser -s $USER
      $ createdb mydatabase
      $ psql -d mydatabase
      

      You should probably be omitting that entirely and letting all the commands default to the user’s name instead.

      $ sudo -u postgres createuser -s $USER
      $ createdb
      $ psql
      
    2. Using the SQL administration commands, and connecting with a password over TCP

      $ sudo -u postgres psql postgres
      

      And, then in the psql shell

      CREATE ROLE myuser LOGIN PASSWORD 'mypass';
      CREATE DATABASE mydatabase WITH OWNER = myuser;
      

      Then you can login,

      $ psql -h localhost -d mydatabase -U myuser -p <port>
      

      If you don’t know the port, you can always get it by running the following, as the postgres user,

      SHOW port;
      

      Or,

      $ grep "port =" /etc/postgresql/*/main/postgresql.conf
      

    Sidenote: the postgres user

    I suggest NOT modifying the postgres user.

    1. It’s normally locked from the OS. No one is supposed to “log in” to the operating system as postgres. You’re supposed to have root to get to authenticate as postgres.
    2. It’s normally not password protected and delegates to the host operating system. This is a good thing. This normally means in order to log in as postgres which is the PostgreSQL equivalent of SQL Server’s SA, you have to have write-access to the underlying data files. And, that means that you could normally wreck havoc anyway.
    3. By keeping this disabled, you remove the risk of a brute force attack through a named super-user. Concealing and obscuring the name of the superuser has advantages.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.