Typically that error means there is a cn=config already when you try to slapadd 
it.

Mit kollegialen Grüßen
Ulrich Windl

From: Nick <atod101...@gmail.com>
Sent: Sunday, June 29, 2025 7:50 AM
To: openldap-b...@openldap.org
Cc: openldap-technical@openldap.org
Subject: [EXT] slapadd: could not add entry dn="cn=config" (line=1):

Does anyone know the source and resolution to this installation error?  
Interestingly, if I use an alternate command I'm able to bring up the server, 
in which I can see via debug it's responding to the client.

I'm following:
https://www.openldap.org/doc/admin24/quickstart.html

Import the configuration database
su root -c /usr/local/sbin/slapadd -n 0 -F /usr/local/etc/slapd.d -l 
/usr/local/etc/openldap/slapd.ldif

and encounter this error.  I see many posts on it with no resolution.  I'm 
using MacPorts openldap 2.6.10.

Interestingly, if I invoke this suggested command:
/opt/local/libexec/slapd -f /opt/local/etc/openldap/slapd.conf -F 
/opt/local/etc/slapd.d

I can invoke slapd and my LDAP server comes up.  It responds back to:
/opt/local/bin/ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts

but without dc=site,dc=com
only blank
dn:

dn:

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

There is nothing in my etc/slapd.d directory.

I try:
ldapadd -d 3 -x -D "cn=Manager,dc=p0,dc=mac" -W -f file.txt
Enter LDAP Password:
ldap_bind: Invalid DN syntax (34)
additional info: invalid DN

Not sure how to approach this and any guidance appreciated.

Reply via email to