rake db:create fails, authentication problem with postgresql 8.4

后端 未结 6 1481
逝去的感伤
逝去的感伤 2021-02-06 07:19

first things first, please excuse my utter noobness. I really tried to find a solution out there, but now i\'m stuck and completely clueless.

i\'m trying to deploy a rai

6条回答
  •  借酒劲吻你
    2021-02-06 07:47

    I was also stuck on this problem for a really long time, and went to a variety of links (including the ones offered in this post) to try and find the answer, but to no avail. However, the solution is very simple. While many of the other responses were on the right track here are the exact steps to solve the problem:

    1. Open your pg_hba.conf file in a text editor of your choice. (It is located in /etc/postgresql//main)

    2. Navigate to the line that reads:

      # "local" is for Unix domain socket connections only

    and paste below it:

      local all         all                 trust
    

    This will trust all unix users trying to connect to the psql server on the local machine. (Read documentation at top of page for further info about function of columns)

    1. Save the pg_hba.conf file and exit the text editor.

    2. Restart the Postgresql server by running the command:

      service postgresql restart

    3. Now try and start a psql server by running:

      psql -d -U (or "psql " for short)

    4. You should be able log in with no problem.

    *Note: All this assumes that you have have a valid psql username for logging in. If you don't follow the links below to set one up:

    Setting up a user: http://erikonrails.snowedin.net/?p=274

    Making sure you have a valid postgres user: http://archives.postgresql.org/pgsql-novice/2002-08/msg00072.php

    Listing all existing psql users: If you are looking for a "LIST USERS" or "DISPLAY USERS" command then try:

    "select * from pg_user;" (when logged in to psql)

    Good luck!

提交回复
热议问题