title: LDAP error: "no database configured for that naming context" when adding custom objectclass
body: <p>I have configured an openLDAP server for testing purposes and am trying to add a few users from the actual LDAP server. The problem is that they have some attributes that are not defined in the default object classes- top, person or organizationalPerson. So I am trying to define my own object class- <code>user</code> with one new attribute for start called <code>instanceType</code>. This is the schema file I created- <code>object_class.schema</code>:</p>
  <pre><code>attributetype ( 1.3.6.1.4.1.42.2.27.4.1.6
          NAME 'instanceType'
          DESC 'instanceType attribute'
          EQUALITY caseExactMatch
          SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
          SINGLE-VALUE )
  
  objectclass ( 1.3.6.1.4.1.42.2.27.4.2.1
          NAME 'user'
          DESC 'user object'
          SUP top
          STRUCTURAL
          MUST ( cn $ instanceType ) )
  </code></pre>
  <p>I also created <code>object_class.conf</code>:</p>
  <pre><code>include /ldap-data/object_class.schema
  </code></pre>
  <p>After that I am running <code>slaptest -f /ldap-data/object_class.conf -F /ldap-data/schemas/</code> which produces the following file- <code>/ldap-data/schemas/cn=config/cn=schema/cn={0}object_class.ldif</code>
  I am stopping the slapd service but when I run <code>slapadd -l /ldap-data/schemas/cn\=config/cn\=schema/cn\=\{0\}object_class.ldif -n 0</code>
  I receive:</p>
  <pre><code>slapadd: line 1: database #0 (cn=config) not configured to hold &quot;cn={0}object_class&quot;; no database configured for that naming context
  _#################### 100.00% eta   none elapsed            none fast!         
  Closing DB...
  </code></pre>
  <p>Is my schema wrong? I tried finding the attributes for the &quot;user&quot; data class which I thought are standard but I couldn't.</p>