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 8035611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:21:34+00:00 2026-06-05T02:21:34+00:00

I either forgot or mistyped (during the installation) the password to the default user

  • 0

I either forgot or mistyped (during the installation) the password to the default user of PostgreSQL. I can’t seem to be able to run it, and I get the following error:

psql: FATAL:  password authentication failed for user "hisham"
hisham-agil: hisham$ psql

Is there a way to reset the password or how do I create a new user with superuser privileges?

I am new to PostgreSQL and just installed it for the first time. I am trying to use it with Ruby on Rails and I am running Mac OS X v10.7 (Lion).

  • 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-06-05T02:21:35+00:00Added an answer on June 5, 2026 at 2:21 am
    1. Find the file pg_hba.conf. It may be located, for example, in /etc/postgresql-9.1/pg_hba.conf.

      cd /etc/postgresql-9.1/

    2. Back it up

      cp pg_hba.conf pg_hba.conf-backup

    3. Place the following line (as either the first uncommented line, or as the only one):

      For all occurrence of below (local and host) , except replication
      section if you don’t have any it has to be changed as follow ,no MD5
      or Peer authentication should be present.

      local all all trust

    4. Restart your PostgreSQL server (e.g., on Linux:)

      sudo /etc/init.d/postgresql restart

      If the service (daemon) doesn’t start reporting in log file:

      local connections are not supported by this build

      you should change

      local all all trust

      to

      host all all 127.0.0.1/32 trust

    5. You can now connect as any user. Connect as the superuser postgres (note, the superuser name may be different in your installation. In some systems it is called pgsql, for example.)

      psql -U postgres

      or

      psql -h 127.0.0.1 -U postgres

      (note that with the first command you will not always be connected with local host)

    6. Reset the password (‘replace my_user_name with postgres since you are resetting the postgres user)

      ALTER USER my_user_name with password 'my_secure_password';

    7. Restore the old pg_hba.conf file as it is very dangerous to keep around

      cp pg_hba.conf-backup pg_hba.conf

    8. Restart the server, in order to run with the safe pg_hba.conf file

      sudo /etc/init.d/postgresql restart

    Further reading about that pg_hba file: 19.1. The pg_hba.conf File (official documentation)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a Mac that I can run either the Leopard (10.5) or Snow
Either I missed some backlash or backlashing does not seem to work with too
I either get a you need a ; here or a best overloaded match
I can either have an auto increment id field as my primary key or
I've got git installed on my mac and either forgot or decided not to
I am trying to perform a simple jQuery AJAX attempt using either a .get()
SOLVED so i forgot to sudo apt-get php5-sqlite also. downvoters gonna downvote :D (fyi,
Using jQuery i would like to run a function when either .change() or .keyup()
either I'm missing something or the ( patterns & practices Composite Application Guidance for
Either of these options would be fabulous: Send a bitmap image of the stage's

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.