Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvSny-0004lX-Nn for pgsql-general@arkaria.postgresql.org; Sat, 15 Oct 2016 17:31:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bvSny-0004mz-7N for pgsql-general@arkaria.postgresql.org; Sat, 15 Oct 2016 17:31:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bvSle-0002AH-En for pgsql-general@postgresql.org; Sat, 15 Oct 2016 17:29:06 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bvSlW-0004TK-B2 for pgsql-general@postgresql.org; Sat, 15 Oct 2016 17:29:05 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 3F377206F4; Sat, 15 Oct 2016 13:28:55 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Sat, 15 Oct 2016 13:28:55 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=QGG5bLI001u1xQpuxM4ab0EuKzs=; b=XJ3Sts g2sHIXiOSUlmgqEfD6Xbqx9HA1+2gTlChheK6Si3sjQkTVyv3BtfWsKbJuW+USpH 2Sel9pZ/KVhR0yFUm0dAT9Az+mYflLelPhV759OfCXdP1FAWa98fn7OEekQ/chfx GcLDewZXWgkQ21/OPX2k4K3XEUDCIMD6wS+Gg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=QGG5bLI001u1xQp uxM4ab0EuKzs=; b=Z20iivlsST3cmCVuQNGOau1pNYkFXMASDt9weAlYWX/f+9l ewklI0jgApmPpbe89H4TBPD6hVPAL8zOzkI/KQOSTfTLtoaAokBOTy9YOL5BdXJ7 tBOXNNrZSntzcLFK3rre7yT8D+Ry+iZJkoiQ01iJYQibhMCcs0t1sIY+CdtE= X-Sasl-enc: LbS14TtesZ8ucyKrlpJALTueFu5MwbGRTB/loc+/qN/p 1476552534 Received: from [192.168.1.2] (174-21-191-61.tukw.qwest.net [174.21.191.61]) by mail.messagingengine.com (Postfix) with ESMTPA id ADC23CC0C2; Sat, 15 Oct 2016 13:28:54 -0400 (EDT) Subject: Re: could not connect to server To: Antonio Silva , pgsql-general@postgresql.org References: From: Adrian Klaver Message-ID: Date: Sat, 15 Oct 2016 10:28:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 10/15/2016 10:11 AM, Antonio Silva wrote: > Hello > > I'm using postgres 9.5 on Ubuntu 16.04. I have worked with pg in my > notebook for almost a month but today postgres did not connected. I > tryed both PGAdmin and psql. Did you do an apt-get upgrade in the interim? > > I also tried to login using my own user and postgres but I received the > messages: > > Server doesn't listen > The server doesn't accept connections: the connection library reports > could not connect to server: Conexão recusada (connection refused) Is > the server running on host "127.0.0.1" and accepting TCP/IP connections > on port 5432? This is indication that Postgres server is not running which is confirmed by your pg_lsclusters output below. > > ~$ psql database > WARNING: password file "/home/antonio/.pgpass" has group or world > access; permissions should be u=rw (0600) or less > psql: could not connect to server: Arquivo ou diretório não encontrado > (File or directory not found) > Is the server running locally and accepting > connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? > > $ pg_lsclusters > Ver Cluster Port Status Owner Data directory Log file > 9.5 main 5432 down postgres /var/lib/postgresql/9.5/main > /var/log/postgresql/postgresql-9.5-main.log > > It was the first time I received the warning "password file > "/home/antonio/.pgpass" has group or world access; permissions should be > u=rw (0600) or less" and I fixed it: > -rw------- 1 antonio antonio 137 Set 30 18:50 .pgpass > > I had edited postgresql.conf and pg_hba.conf but this morning they were > in their original configuration. So I edited again to: > > /etc/postgresql/9.5/main/postgresql.conf > > # - Connection Settings - > listen_addresses = '*' > port = 5432 > > /etc/postgresql/9.5/main/pg_hba.conf > > # Database administrative login by Unix domain socket > local all postgres md5 > # TYPE DATABASE USER 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 > > I also restarted the server (/etc/init.d/postgresql restart) and the > computer. What does pg_lsclusters show? How did you try to connect? > > I really appreciate any guidance. > > All the best, > > Antônio Olinto > São Paulo, Brasil -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general