Play 2.0 PostgreSQL Cannot connect to database [default] only on wireless

My Play 2.0 database is set up to use a PostgreSQL connection and it works fine on my wired internet connection. However, when I try to connect from a wireless internet connection i receive the Cannot connect to database [default] error. Can anyone please help me figure out why this is?



Database URL variable set up in .bashrc file:



pg_hba.conf file:

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all               trust
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     tvonehwegen                                md5
#host    replication     tvonehwegen            md5
#host    replication     tvonehwegen        ::1/128                 md5

postgresql.conf file:

# - Connection Settings -

#listen_addresses = 'localhost'     # what IP address(es) to listen on;
                # comma-separated list of addresses;
                # defaults to 'localhost'; use '*' for all
                # (change requires restart)
#port = 5432                # (change requires restart)
max_connections = 100           # (change requires restart)

Turns out the only problem here is that I can not connect to my local postgreSQL database when I am connected to a wireless network. Does anyone know why that may be? Thanks!


Check your WiFi/Internet settings for IPv6. On some networks your machine gets an IPv6 address in addition to the traditional IPv4 one. In such cases, usually, localhost gets mapped to ::1 instead of; which means things will go wrong if you have setup pg_hba.conf to grant access based on IPv4 addresses.

Assuming firewall is off, e.g. on Redhat based systems service iptables stop, and the following snippets exists in relevant files:


host    all             all               md5
host    all             all             ::1/128                 md5


listen_addresses = '*'

You should be able to connect to the desired database as follows:

$ psql -h ::1 -U USERNAME -d DATABASE
Password for user USERNAME: 
psql (9.1.11)
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Type "help" for help.



Password for user USERNAME: 
psql (9.1.11)
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Type "help" for help.


Finally Play's JDBC connection settings should be of the following form:


NOTE: I'd strongly suggest you never use localhost in a connection string. 99.99% of the time what you need is

Need Your Help

You tube videos are not playing

android youtube-api

I am using OpenYoutubeActivity.jar to play youtube videos like this

Flask 405 Method Error

python html sqlite flask

Hi i'm trying to add a contact to my sqlite db although I keep getting a 405 method error. Any ideas??