title: PostgreSQL - FATAL: Ident authentication failed for user
body: <p>I've created a simple table in postgres called <code>employees</code> in database <code>mytestdb</code></p>
  
  <p>I would like to import this table into hdfs.</p>
  
  <pre><code>bin/sqoop import --connect 'jdbc:postgresql://127.0.0.1/mytestdb' --username user -P --table employees --target-dir /user/postgres
  </code></pre>
  
  <p>But, I keep receiving an error:</p>
  
  <blockquote>
    <p>WARNING: SQLException occurred while connecting to 127.0.0.1:5432
    org.postgresql.util.PSQLException: FATAL: Ident authentication failed
    for user "user"   at
    org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:473)</p>
  </blockquote>
  
  <p><code>/var/lib/pgsql/data/pg_hba.conf</code> set up as follows:</p>
  
  <pre><code># TYPE  DATABASE        USER            ADDRESS                 METHOD
  
  # "local" is for Unix domain socket connections only
  local   all             all                                     md5
  # IPv4 local connections:
  host    all             all             127.0.0.1/32            ident
  # IPv6 local connections:
  host    all             all             ::1/128                 ident
  # Allow replication connections from localhost, by a user with the
  # replication privilege.
  #local   replication     postgres                                peer
  #host    replication     postgres        127.0.0.1/32            ident
  #host    replication     postgres        ::1/128                 ident
  </code></pre>