To generate slapd.conf to xyzschema.ldif

Using this

slapcat -f slapd.conf.schemaname -F /tmp/schema -n0 -s cn=schema,cn=config

Schema file has been created. 

But when I am trying to add this schema using
ldapadd -D cn=admin, cn=config  -W -f cn\=\{0\}schemaname.ldif

Getting Error ldap_bind: Invalid credentials (49)

I figure out that my credentials are not configured properly.

So, I create a: manage.ldif file

dn: olcDatabase={1}bdb,cn=config
changetype: modify
replace: olcRootPW
olcRootPW: {SHA}GvyYSUqNK/Uo/Cva399YZUPUFNM=

ldapmodify -Y EXTERNAL -H ldapi:/// -f manager.ldif

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
modifying entry "olcDatabase={1}bdb,cn=config"

But still, when I am trying to add my customize schema, getting same error
Error ldap_bind: Invalid credentials (49)

Please fine the Attachment,

System configuration:

Ubuntu 14.04

Installed slapd: apt-get install slapd ldap-utils
Configured by:- dpkg reconfigure slapd
dc=my-xyxdomain, dc=com
used: bdb
Later configured phpldapadmin.

Working fine.

Abhishek Koserwal
Final year, CSE, IET-DAVV

The capacity to learn is a gift; The ability to learn is a skill; The willingness to learn is a choice -- Brian Herbert