title: Error when running ldapsearch -H ldap:// -x -s base -b “” -LLL “+”
body: <p>I am new to <code>LDAP</code> and <code>OpenLDAP</code></p>
  
  <p>When running very basic <code>ldapsearch</code></p>
  
  <pre><code>ldapsearch -H ldap:// -x -s base -b “” -LLL “+”
  </code></pre>
  
  <p>It returns </p>
  
  <pre><code>ldapsearch: invalid option -- 'H'
  </code></pre>
  
  <p>in CentOS 7</p>
  
  <p>but if I run</p>
  
  <pre><code>sudo ldapsearch -H ldap:// -x -s base -b “” -LLL “+”
  </code></pre>
  
  <p>the <code>invalid option</code> error is gone but then it returns</p>
  
  <pre><code>Invalid DN syntax (34)
  Additional information: invalid DN
  </code></pre>
  
  <p>I think it looks like I messed up some of the configuration, all I did was following instruction from this <a href="http://www.itzgeek.com/how-tos/linux/centos-how-tos/step-step-openldap-server-configuration-centos-7-rhel-7.html" rel="nofollow noreferrer">tutorial</a></p>
  
  <p>Please let me know any extra information i should provide here and how can I resolve the problem. I am really newbie in <code>(Open)LDAP</code>.</p>
  
  <h1>UPDATE</h1>
  
  <p>Content of <code>/etc/openldap/slapd.d/db.ldif</code></p>
  
  <pre><code>dn: olcDatabase={2}hdb,cn=config
  changetype: modify
  replace: olcSuffix
  olcSuffix: dc=myname,dc=local
  
  dn: olcDatabase={2}hdb,cn=config
  changetype: modify
  replace: olcRootDN
  olcRootDN: cn=ldapadm,dc=myname,dc=local
  
  dn: olcDatabase={2}hdb,cn=config
  changetype: modify
  replace: olcRootPW
  olcRootPW: {SSHA}123123123123123123123
  </code></pre>