【问题标题】:How do I authenticate with txcouchbase?如何使用 txcouchbase 进行身份验证?
【发布时间】:2019-08-05 18:31:47
【问题描述】:

我通过 bucket = Bucket("couchbase://localhost/users") 连接到我的 couchbase 服务器,但是由于服务器有用户名和密码,我该如何进行身份验证?

【问题讨论】:

    标签: python python-3.x couchbase


    【解决方案1】:

    我将从"Hello Couchbase" example in the documentation 开始。在撰写此答案时,即:

    from couchbase.cluster import Cluster
    from couchbase.cluster import PasswordAuthenticator
    cluster = Cluster('couchbase://localhost')
    authenticator = PasswordAuthenticator('username', 'password')
    cluster.authenticate(authenticator)
    cb = cluster.open_bucket('bucket-name')
    

    【讨论】:

    • 那不是使用 txcouchbase。我需要异步版本。不过感谢您的回答!
    猜你喜欢
    • 1970-01-01
    • 2017-11-24
    • 1970-01-01
    • 1970-01-01
    • 2017-11-10
    • 2011-07-15
    • 2020-05-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多