SQLAlchemy no password supplied error

postgresql, sqlalchemy

Solution

You probably just need to remove "localhost" from your connection string:

'postgresql:///db_name'

That tells psycopg2 to use Unix-domain sockets. Your default configuration will use "ident" so you'll be connecting as the user that runs the script. In the default configuration, "md5" only applies to TCP connections.

Problem

This is probably a silly error but I cannot seem to find a satisfying solution. When running `db.create_all()`, I got the following error. ``` sqlalchemy.exc.OperationalError: (OperationalError) fe_sendauth: no password supplied None None ``` My database link is set as ``` 'postgresql://localhost/db_name' ``` This worked fine on my Mac and Heroku, but is not OK on ubuntu (digitalocean). Any ideas what I might be doing wrong?

Original source