title: PSQLException: The server requested password-based authentication, but no password was provided
body: <p>I have a Spring Boot project where I'm trying to connect to a local PostgreSQL database. The data source is being instantiated from DataSourceBuilder. For the purposes of this example, I have the database username, password, and database URL hard-coded (they will be passed in through properties files), and this is what the implementation looks like:</p>
  
  <pre><code>String url = "jdbc:postgresql://localhost:5433/&lt;TABLENAME&gt;";
  
  String username = &lt;USERNAME&gt;;
  String password = &lt;PASSWORD&gt;;
  
  return DataSourceBuilder
              .create()
              .driverClassName("org.postgresql.Driver")
              .url(url)
              .username(username)
              .password(password)
              .build();
  </code></pre>
  
  <p>When I run the Spring Application main method, the following exception is thrown:</p>
  
  <pre><code>Caused by: org.postgresql.util.PSQLException: 
  The server requested password-based authentication, but no password was provided.
  at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:534)
  at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:141)
  at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192)
  </code></pre>
  
  <p>I tried changing the <em>postgres</em> user password a few times using <code>sudo passwd postgres</code> but that didn't seem to work. Any ideas?</p>