fedora 20中安裝postgresql資料庫

來源:互聯網
上載者:User

標籤:os   使用   for   ar   資料   2014   art   cti   on   

在fedora 20中在我2014-8-27日安裝pg時,pg版本是9.3.5.1我不知是會由pg開發組自動更新還是別的,但安裝後一般是最新的版本了。
安裝:

yum install postgresql yum install postgresql-server yum install pgadmin3 yum install postgresql-contrib yum update postgresql-setup initdb systemctl enable postgresql.service

直接使用pgadmin3, 然後就發現了下面的錯誤: Error connecting to the server: 致命錯誤: 使用者 “postgres” Ident 認證失敗 切換到postgres使用者,#su - postgres $psql進入到postgres的控制shell, \passwd, 指定新的密碼 修改 pg_hba.conf 將它的認證方式由 ident改成md5 再pg_ctrl restart, 重啟, 好用了。

但我在修改了使用者的密碼,不能登入,於是乎做了以下的操作
密碼登入:
1、編輯pg_hba.conf,將md5認證修改成trust認證,編輯後退出儲存

[postgres @ pgsqldb-master bin]$ vi ../data/pg_hba.conf

2、執行pg_ctl reload載入生效

[postgres @ pgsqldb-master bin]$ pg_ctl reload
server signaled

3、psql串連,用alter role修改密碼
[postgres @ pgsqldb-master bin]$ psql
psql (9.2.3)
Type “help” for help.

postgres=# alter role postgres with password ‘123‘;
ALTER ROLE
postgres=#

4、退出psql
5、編輯pg_hba.conf,將turst認證修改成md5認證,編輯後退出儲存
6、執行pg_ctl reload載入生效

fedora 20中安裝postgresql資料庫

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.