title: Connect as user with no password set on Postgresql 8.4 via JDBC
body: <p>I'm trying to connect to a <code>PostgreSQL</code> 8.4 DB in Ubuntu 10.10 via the JDBC drivers. I'm connecting via <code>jdbc:postgresql:localhost:5433/dbname</code> because PostgreSQL is running on a non-default port 5433 so I have to specify the port.</p>
  
  <p>I've already edited my <code>postgresql.conf</code> to set <code>listen_addresses = "*"</code>. I understand that even though it's localhost, it's still using TCP/IP to connect via JDBC.</p>
  
  <p>My problem is that I created a user without a password. If i do not specify a password with <code>DriverManager.connect(url)</code>, it errors indicating that I need to specify a password for authentication. Every password I try, including empty string, fails to authenticate with the DB.</p>
  
  <p>How can I connect?</p>
  
  <p>Edit:
  If connecting over wrong port, the error is : PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. When attempting to connect on the correct port, I'm getting PSQLException: FATAL: password authentication failed for user "user". THis is remedied by the accepted answer below.</p>