database "postgresql"kag does not existt怎么办

PostgreSQL 错误码 PostgreSQL 手册pgsql-novice@postgresql.org (date)
May 29, 2009
, Richard Broersma, 22:44
, Richard Broersma, 22:36
, Karl Nack, 22:23
May 28, 2009
, Jasen Betts, 13:54
, Dave Page, 12:07
, Anirban Pal, 11:20
, Anirban Pal, 11:19
May 27, 2009
, Zach Calvert, 22:48
, Tom Lane, 21:52
, Zach Calvert, 18:10
, Thomas Kellerer, 18:00
, Tom Lane, 17:33
, Joshua Tolley, 17:30
, Tom Lane, 17:09
, Emanuel Calvo Franco, 17:01
, Zach Calvert, 16:35
, Emanuel Calvo Franco, 16:34
, Just E. Mail, 16:22
, Merlin Moncure, 16:20
, Just E. Mail, 12:30
, Just E. Mail, 01:10
, Tom Lane, 01:03
, Dale Seaburg, 00:59
May 26, 2009
, Ron Arts, 22:08
, Alan McKay, 21:37
, Just E. Mail, 20:39
, Alan Hodgson, 20:33
, Just E. Mail, 20:20
, Thomas Kellerer, 18:03
, Tom Lane, 16:34
, Just E. Mail, 16:16
, Ron Arts, 15:19
, Frank Bax, 14:59
, Ognjen Blagojevic, 13:25
, Frank Bax, 11:11
, Ron Arts, 10:38
May 25, 2009
, Just E. Mail, 22:07
, Thomas Kellerer, 18:57
, Daniel Staal, 16:15
, Daniel Staal, 09:05
, vy, 02:28
May 24, 2009
, Kedar Rasik Parikh, 21:31
, Tom Lane, 20:32
, Kedar Rasik Parikh, 20:21
, Daniel Staal, 20:21
, Jasen Betts, 13:43
May 23, 2009
, Just E. Mail, 23:05
, Leif B. Kristensen, 12:41
, Jasen Betts, 12:23
, Alan McKay, 01:33
May 22, 2009
, Mehrotra, Abhinav (GE Healthcare), 12:35
, Leif B. Kristensen, 11:16
, Mehrotra, Abhinav (GE Healthcare), 11:10
, Jana, 01:08
May 21, 2009
, Thomas Kellerer, 13:39
, Thomas Kellerer, 11:05
May 19, 2009
, Jasen Betts, 14:01
May 17, 2009
, Dallas Morisette, 16:16
, Michael Glaesemann, 16:15
, Dallas Morisette, 16:12
, Dallas Morisette, 02:44
May 16, 2009
, Tom Lane, 21:15
, Jana, 19:59
May 15, 2009
, A. Kretschmer, 13:51
, Jason Tan Boon Teck, 13:37
, Mark, 12:33
, Ognjen Blagojevic, 12:16
, A. Kretschmer, 11:31
, Jason Tan Boon Teck, 10:51
May 14, 2009
, Ognjen Blagojevic, 21:28
, Ognjen Blagojevic, 21:21
, Tom Lane, 20:50
, Ognjen Blagojevic, 20:46
, A. Kretschmer, 07:18
, Tom Lane, 01:43
May 13, 2009
, Tom Lane, 16:29
, Avinash Kachhy, 05:27
May 12, 2009
, Pallayya Sarma Karra, 18:05
May 11, 2009
, Neil Saunders, 16:57
, Adam Ruth, 14:36
, Mag Gam, 14:31
, Devrim GÜNDÜZ, 12:48
May 10, 2009
, Just E. Mail, 17:12
, Tom Lane, 00:38
May 09, 2009
, Just E. Mail, 23:13
May 08, 2009
, Joshua Tolley, 18:12
, Pallayya Sarma Karra, 18:02
May 06, 2009
, Lennin Caro, 16:41
, Just E. Mail, 04:16
May 05, 2009
, Cliff Nieuwenhuis, 02:47
, Adam Ruth, 00:42
May 04, 2009
, Adam Ruth, 22:57
, Daniel Staal, 19:22
May 01, 2009
, Fred Moseley, 20:07
, Tom Lane, 19:46
, Fred Moseley, 19:30
, daq, 00:18
, Jasen Betts, 00:10今天看啥 热点:
rails连接postgresql错误:psql: 致命错误:
用户 &postgres& Ident 认证失败,psqlpostgres
psql: 致命错误:& 用户 &postgres& Ident 认证失败
1安装好postgresql数据库后需要初始化及一些配置rails项目才能连接postgresql
安装好postgresql数据后(yum命令直接安装的)
第一步:初始化数据库
#service postgresql initdb
(说明:初始化后默认postgresql数据库有一个默认的用户postgres(密码为空)和一个默认创建的postgres数据库)
第二步:启动数据库
#service postgresql start
如果这个命令不能使用请使用:#systemctl start postgresql.service
来启动数据库,为修改密码条件
第三步:切换用户修改密码
#su postgres
#alter& user postgres with password& 'kuange' ;
(修改postgres用户密码为kuange,这个密码随你自己修改)
第四步:修改认证文件/var/lib/pgsql/data/pg_hba.conf,登陆使用密码。
#vi&&/var/lib/pgsql/data/pg_hba.conf
把这个配置文件中的认证&METHOD的ident修改为trust,可以实现用账户和密码来访问数据库,
即解决psql:
致命错误:& 用户 &postgres& Ident 认证失败 这个问题)
第五步:重启postgresql服务器使设置生效
#service& postgresql& restart
#systemctl& restart postgresql.service
这样问题就解决了,数据库可以正常被rails项目访问了
pg_hba.conf这个文件的完整代码如下:
#=========================================
# PostgreSQL Client Authentication Configuration File
# ===================================================
# Refer to the &Client Authentication& section in the PostgreSQL
# documentation for a complete description of this file.& A short
# synopsis follows.
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which
# databases they can access.& Records take one of these forms:
# local&&&&& DATABASE& USER& METHOD& [OPTIONS]
# host&&&&&& DATABASE& USER& ADDRESS& METHOD& [OPTIONS]
# hostssl&&& DATABASE& USER& ADDRESS& METHOD& [OPTIONS]
# hostnossl& DATABASE& USER& ADDRESS& METHOD& [OPTIONS]
# (The uppercase items must be replaced by actual values.)
# The first field is the connection type: &local& is a Unix-domain
# socket, &host& is either a plain or SSL-encrypted TCP/IP socket,
# &hostssl& is an SSL-encrypted TCP/IP socket, and &hostnossl& is a
# plain TCP/IP socket.
# DATABASE can be &all&, &sameuser&, &samerole&, &replication&, a
# database name, or a comma-separated list thereof. The &all&
# keyword does not match &replication&. Access to replication
# must be enabled in a separate record (see example below).
# USER can be &all&, a user name, a group name prefixed with &+&, or a
# comma-separated list thereof.& In both the DATABASE and USER fields
# you can also write a file name prefixed with &@& to include names
# from a separate file.
# ADDRESS specifies the set of hosts the record matches.& It can be a
# host name, or it is made up of an IP address and a CIDR mask that is
# an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
# specifies the number of significant bits in the mask.& A host name
# that starts with a dot (.) matches a suffix of the actual host name.
# Alternatively, you can write an IP address and netmask in separate
# columns to specify the set of hosts.& Instead of a CIDR-address, you
# can write &samehost& to match any of the server's own IP addresses,
# or &samenet& to match any address in any subnet that the server is
# directly connected to.
# METHOD can be &trust&, &reject&, &md5&, &password&, &gss&, &sspi&,
# &krb5&, &ident&, &peer&, &pam&, &ldap&, &radius& or &cert&.& Note that
# &password& sends pas &md5& is preferred since
# it sends encrypted passwords.
# OPTIONS are a set of options for the authentication in the format
# NAME=VALUE.& The available options depend on the different
# authentication methods -- refer to the &Client Authentication&
# section in the documentation for a list of which options are
# available for which authentication methods.
# Database and user names containing spaces, commas, quotes and other
# special characters must be quoted.& Quoting one of the keywords
# &all&, &sameuser&, &samerole& or &replication& makes the name lose
# its special character, and just match a database or username with
# that name.
# This file is read on server startup and when the postmaster receives
# a SIGHUP signal.& If you edit the file on a running system, you have
# to SIGHUP the postmaster for the changes to take effect.& You can
# use &pg_ctl reload& to do that.
# Put your actual configuration here
# ----------------------------------
# If you want to allow non-local connections, you need to add more
# &host& records.& In that case you will also need to make PostgreSQL
# listen on a non-local interface via the listen_addresses
# configuration parameter, or via the -i or -h command line switches.
# TYPE& DATABASE&&&&&&& USER&&&&&&&&&&& ADDRESS&&&&&&&&&&&&&&&& METHOD
# &local& is for Unix domain socket connections only
local&& all&&&&&&&&&&&& all&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& & & & & & & & trust
# IPv4 local connections:
host&&& all&&&&&&&&&&&& all&&&&&&&&&&&& 127.0.0.1/32&&&&&&&&&&& trust
# IPv6 local connections:
host&&& all&&&&&&&&&&&& all&&&&&&&&&&&& ::1/128&&&&&&&&&&&&&& & & & & trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local&& replication&&&& postgres&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& & & & & & && peer
#host&&& replication&&&& postgres&&&&&&& 127.0.0.1/32&&&&&&&&& && ident
#host&&& replication&&&& postgres&&&&&&& ::1/128&&&&&&&&&&&&& & & & & & ident
#=========================================
你配置的是哪个文件 postgres默认的是拒绝其他用户访问本地数据库的,有一个配置文件是“pg_hba.conf” 添加一行“host
192.168.0.0/16
trust”此功能时以192.168开头的ip可访问,trust设置完全开放不需要认证。
root也是你的postgresql的用户,登录postgresql用 默认的 postgres试试吧
相关搜索:
相关阅读:
相关频道:
&&&&&&&&&&&&&&&&&&&&&&&&&&&&
数据库前沿最近更新}

我要回帖

更多关于 host does not exist 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信