PostgreSQL 설치한 후의 문제들에 대한 질문 입니다..

hyper9의 이미지


갑자기 잘 알지 못하던 PostgreSQL을 쓰려니까..
질문이 많이 생기네요 ..

일단 환경부터 말씀을 드리면요.
Fedora 7이 설치되어 있는 System에,,,

postgresql-libs-8.2.9-1.fc7
postgresql-server-8.2.9-1.fc7
postgresql-8.2.9-1.fc7
과 같은 3개의 package를 설치 했습니다

그리고 etc/init.d를 보니까..
postgresql 이라는 init script도 만들어져 있습니다.

# service postgresql start라고 하면 되지 않을까 싶어서
시도해보니,,
/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize th
e cluster first.
[FAILED]

이런 불평이 나오네요 ...

시키는 대로 "service postgresql initdb" 를 하고
다시 "service postgresql start"를 해보았습니다.

그러고 나니 문제가 일단 안보이네요..

그리고 나서는,,
# psql -U postgres 라고 입력을 해보니...
psql: FATAL: Ident authentication failed for user "postgres"

라는 불평이 나옵니다..

여기저기 Internet을 통한 정보 수집중에 이문제가 혹시 "pg_hba.conf"라는
file의 내용과 관련이 있는게 아닌가 싶어서 찾아봤습니다.

마지막 부분에,,
TYPE DATABASE USER CIDR-ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all ident sameuser
# IPv4 local connections:
host all all 127.0.0.1/32 ident sameuser
# IPv6 local connections:
host all all ::1/128 ident sameuser

이라고 되어 있던데요 ..

이번에는 이 부분을 아래와 같이 수정해 보았습니다.

TYPE DATABASE USER CIDR-ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5

그리고 rebooting을 한 후에,
이번에는
# psql -U postgres 라고 입력해보니,,
Password for user postgres: 라고 postgres User에 대한 password를
묻는데요 ,,

제가 postgres password를 정한 적이 없어서,
그냥 enter를 쳐봐도, 또 "postgres"라고 입력을 해봐도 다 안되네요.

그러면서 다시
psql: FATAL: password authentication failed for user "postgres"
와 같은 error가 나왔습니다.

뭔가 문제가 있는 것 같은데요..
일단은 postgres user에 대한 password가 제대로 설정되어 있지 않은 것 같아보이고요

이런 경우는 어떻게 접근해서 해결을 해야 할지요?
조언 부탁드립니다..

미리 감사드립니다. ^^

블루스크린의 이미지

-------------------------------------------------------------------------------
이 댓글(comment)의 수정 및 삭제를 위해 이 글에 답글(reply)을 쓰지 말아 주십시요.
의견이 있으시면 원 글에 댓글(comment)로 써 주세요.

-------------------------------------------------------------------------------
이 댓글(comment)의 수정 및 삭제를 위해 이 글에 답글(reply)을 쓰지 말아 주십시요.
의견이 있으시면 원 글에 댓글(comment)로 써 주세요.

hyper9의 이미지

하지만,,

md5를 쓰면서 해결할 수 있는 방법은 없을까요?

어디서 읽어보니까,md5를 쓴다는 의미가 user의 password
를 가질 수 있게하고 또 그 encrypt된 password를
지원하는 거라고 본것 같아서요 ..

만일 이러한 목적을 가지고 user를 만든다면 method를 trust
로 바꾸면 좀 다른 해결책이 되는게 아닌가 싶어서요..

답변 다시 감사드리고,, 추가 조언도 언제나 감사드립니다. ^^

소타의 이미지

일단 처음에 postgres 유저에 대한 비밀번호를 설정해야 md5가 가능하니까 trust로 하시거나
루트에서 su - postgres
로 postgres 유저로 전환 후에 psql 하면 ident인증이 수행됩니다.
그다음엔 유저를 생성후에 enjoy

hyper9의 이미지

아직도 너무 모르는게 많아서 또 질문을 드립니다.

일단 말씀하신 대로 root에서 "su - postgres"로 전환해서 psql이라고
수행을 했습니다.

그러니까 postgres# 라는 prompt가 나오네요.
이게 ident 인증이 수행된 상태인가요?

그리고 제가 필요했던 user는 postgres인데요..
이 user는 일단 생성된 상태가 아닐까요?

그리고 혹시나 해서 PostgreSQL document의 SQL commands list를
봤는데,,거기에 Password를 바꾸는 command는 없는 것 같네요.

제가 본게 맞는걸까요?
항상 답변 감사드립니다.

소타의 이미지

create user 사용자이름 (여기까지 하고 탭 눌러보시면 옵션들 나옴)

alter user 사용자이름 e(e까지 누르고 탭 두번 하고 비밀번호를 ' 로 감싸주면 됨)

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.