Curl 无法在CouchDB中创建管理员用户

Curl 无法在CouchDB中创建管理员用户,curl,couchdb,Curl,Couchdb,我安装了CouchDB,但无法创建具有管理员权限的用户帐户 curl -s -X PUT http://localhost:5984/_config/admins/xyz -d '"qwerty"' {"error":"unauthorized","reason":"You are not a server admin."} 如果我给出的是curl localhost:5984,那么我就不会得到uuid {"couchdb":"Welcome","version":"2.1.1","feat

我安装了CouchDB,但无法创建具有管理员权限的用户帐户

curl -s -X PUT http://localhost:5984/_config/admins/xyz -d '"qwerty"'

{"error":"unauthorized","reason":"You are not a server admin."}
如果我给出的是curl localhost:5984,那么我就不会得到uuid

{"couchdb":"Welcome","version":"2.1.1","features":["scheduler"],"vendor":{"name":"The Apache Software Foundation"}}

首先,要使用
curl
修改配置,必须包括您所关心的CouchDB
\u节点。节点信息由以下人员公开:
/_节点/couchdb@127.0.0.1/…

其次,curl命令应该包含具有现有管理员用户名/密码的授权,以便能够修改CouchDB节点配置。现有管理员由以下人员授权:
。。。管理员:***@192.168.1.100…

因此,此命令适用于我:

$ curl -k -X PUT https://admin:****@192.168.1.100:6984/_node/couchdb@127.0.0.1/_config/admins/xyz -d '"qwerty"'
它为我创建
xyz
管理员,没有任何问题:


注意,我正在使用端口
6984
,因为我已经为我的CouchDB启用了
HTTPS