The problem is the user is not granted to connect the database. GRANT CONNECT ON DATABASE TO USER UserName;