Search:

Search all manuals
Search this manual
Manual
Couchbase Developer's Guide 1.8
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
3.2 Connecting to Couchbase Server
Chapter Sections
Chapters

3.2.3. Authenticating a Client

When you create a connection to the Couchbase Server, you are actually creating a new instance of the bucket containing your information. Typically when you established a bucket for your application, either in Couchbase Administrative Console, or via an SDK call, you provide required credentials. When you connect to the bucket, provide your username and password as parameters in your call to Couchbase.connect():

Couchbase.connect("http://<host>:8091/pools",
                                          :bucket => 'bucket1',
                                          :username => 'Administrator',
                                          :password => 'password')

This next example demonstrates use of credentials in PHP:

<?php
        $cb = new Couchbase(”<host>:8091", "bucketname", "pass", "user");
        ?>