trouble connecting with psql to running server

Gavin M2301 <[email protected]> Tue, 7 May 2019 23:04:30 -0400
Newsgroups gmane.comp.db.postgresql.novice
Message-ID <CAHiusVjB8KzqnHvJXaUZpdeD7tBTWwmr=3H6xJed=eDwKXAL7Q@mail.gmail.com>
Hi all-

I can't connect by psql like this:

./psql -h localhost -p 5432 -d template1.

Here is some data:
$ ./psql -h 127.0.0.1 -p 5342   -d template1
psql: error: could not connect to server: could not connect to server:
Connection refused (0x0000274D/10061)
        Is the server running on host "127.0.0.1" and accepting
        TCP/IP connections on port 5342?
$ ./postgres -d 3 -D C:/msys64/usr/local/pgsql/data  -c
config_file=/c:/msys64/usr/local/pgsql/data/postgresql.conf

2019-05-07 22:39:19.833 EDT [23160] LOG:  starting PostgreSQL 12devel on
x86_64-w64-mingw32, compiled by x86_64-w64-mingw32-gcc.exe (Rev2, Built by
MSYS2 project) 8.3.0, 64-bit
2019-05-07 22:39:19.838 EDT [23160] LOG:  listening on IPv6 address "::1",
port 5432
2019-05-07 22:39:19.838 EDT [23160] LOG:  listening on IPv4 address
"127.0.0.1",
It (postmaster) is still going. No idea why I can't connect with psql
client.

Here is my pg_hba.conf:

# 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.
host    replication     all             127.0.0.1/32            trust
host    replication     all             ::1/128                 trust

Any ideas guys/gals?
I normally don't get this stuck. There is something blocking ./psql from
connecting to anything.
I might want to mention I built it with mingw. I put the bin directory in
path. I am using mingw msys2. I don't see a process when I do ps -ef | grep
postgres but I can see where the server is running continually. I am using
the version on GitHub.

thanks for any ideas on what I can try.
roboloki