Ytake/laravel-couchbase LCB_AUTH_ERROR


#1

I’m new to use couchbase, I have uploaded package from ‘https://github.com/ytake/Laravel-Couchbase’,

using laravel 5.5.

and I follow with the readme like below

in app/config.php:

    'couchbase' => [
        'driver' => 'couchbase',
        'host' => 'couchbase://127.0.0.1',
        'user' => 'test', // optional administrator
        'password' => 'test123', // optional administrator
        // optional configuration / management operations against a bucket.
        'administrator' => [
            'user'     => 'Administrator',
            'password' => 'password',
        ],
    ],

in controller file:
public function index(){

    /* it can work
    $cluster = new \CouchbaseCluster('127.0.0.1');
    $cluster->authenticateAs('test','test123');
    $bucket =$cluster->openBucket('mall_orders');
    $query = \CouchbaseN1qlQuery::fromString('SELECT * FROM mall_orders ');
    $results = $bucket->query($query);

    var_dump($results);
    */

    DB::connection('couchbase')->table('mall_activities')->get();
}

and I got a problem
LCB_AUTH_ERROR: Authentication failed. You may have provided an invalid username/password combination (SQL: select * from mall_activities)


#2

Hi @2101132099,

This question probably belongs in the PHP forum: https://forums.couchbase.com/c/php-sdk

I’m no PHP expert, but does a user named “test” exist with a password of “test123”? Does an administrator exist with a username of “Administrator” and password of “password”?

Also, you might want to try asking over on the GitHub project itself. I’ll also tag @avsej, he might also be able to help.