postgres "could not connect to server: Connection refused"

sdementen's Avatar

sdementen

12 Nov, 2015 05:15 PM

Hello,

I can't find a way to create a database using the postgres service in appveyor.

I have the following in my logs

echo *:*:*:*:Password12! > %USERPROFILE%\.pgpass
cat %USERPROFILE%\\.pgpass
*:*:*:*:Password12!
SET PGUSER=postgres
SET PGPASSWORD=Password12!
SET PATH=C:\Program Files\PostgreSQL\9.4\bin\;%PATH%
createdb foo
createdb: could not connect to database template1: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Command exited with code 1

And in my yml

services:
  - postgresql
  - mysql

install:
  - "echo *:*:*:*:Password12! > %USERPROFILE%\\.pgpass"
  - cat %USERPROFILE%\\.pgpass
  - "SET PGUSER=postgres"
  - "SET PGPASSWORD=Password12!"
  - "SET PATH=C:\\Program Files\\PostgreSQL\\9.4\\bin\\;%PATH%"
  - "createdb foo"

Any hint on how to solve this ?

  1. Support Staff 1 Posted by Feodor Fitsner on 12 Nov, 2015 05:23 PM

    Feodor Fitsner's Avatar

    Can you send me a full log please or give a link to the build of it's public?

    - Feodor

  2. 2 Posted by sdementen on 12 Nov, 2015 06:23 PM

    sdementen's Avatar
  3. Support Staff 3 Posted by Feodor Fitsner on 12 Nov, 2015 06:30 PM

    Feodor Fitsner's Avatar

    I see now. This is because services are started after install section.

  4. 4 Posted by sdementen on 13 Nov, 2015 05:52 AM

    sdementen's Avatar

    Thanks! It works now perfectly

  5. 5 Posted by henry on 30 May, 2016 02:22 AM

    henry's Avatar

    Hi Feodor

    could you help me with my appveyor file.
    I am failing to handle PostgreSQL. (https://github.com/henrykironde/deletedret/blob/new-tests/appveyor.yml)

  6. Support Staff 6 Posted by Feodor Fitsner on 30 May, 2016 05:29 PM

    Feodor Fitsner's Avatar

    You've forgot to set PGPASSWORD: Password12!.

  7. 7 Posted by henry kironde on 31 May, 2016 02:49 PM

    henry kironde's Avatar
  8. Support Staff 8 Posted by Feodor Fitsner on 31 May, 2016 04:44 PM

    Feodor Fitsner's Avatar

    But there is no error after createdb testdb command: https://ci.appveyor.com/project/henrykironde/deletedret/build/1.0.1... ?

  9. 9 Posted by deepthy on 08 Mar, 2017 01:46 PM

    deepthy's Avatar

    could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?

  10. Support Staff 10 Posted by Ilya Finkelshte... on 08 Mar, 2017 07:05 PM

    Ilya Finkelshteyn's Avatar

    @deepthy please elaborate situation more. YAML configuration and build logs will not hurt.

  11. 11 Posted by henry on 08 Mar, 2017 07:23 PM

    henry's Avatar

    @deepthy please check with my project, You may get some answers of how to set things up https://github.com/weecology/retriever

  12. 12 Posted by Raju on 13 Mar, 2018 05:57 AM

    Raju's Avatar

    I am trying to accesss Remote connection in PostgreSQL , I did all that changes in
    .hba and .conf file in Client System

    If I enter " psql -h 192.168.10.235 -U postgres " this With Client IP address I am gettinf the following error.

     psql: could not connect to server: Connection refused (0x0000274D/10061)
            Is the server running on host "192.168.10.235" and accepting
            TCP/IP connections on port 5432?

  13. Support Staff 13 Posted by Ilya Finkelshte... on 13 Mar, 2018 05:43 PM

    Ilya Finkelshteyn's Avatar

    Raju can you please clarify where IP address 192.168.10.235 came from?

  14. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:27 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac