Simple code to connect to couchbase/bucket. I get Generic error
. I tried different connstr
strings - commented all except one. Failed for all strings. Username and passwords are correct as I could successfully use those in the web UI.
I’m very new to couchbase (just couple of days) - sorry if this question was already asked before…
Here is the code:
int main()
{
lcb_error_t err;
lcb_t instance;
struct lcb_create_st create_options = { 0 };
lcb_CMDSTORE scmd = { 0 };
lcb_CMDGET gcmd = { 0 };
// Connect to couchbase [create(), wait(), and check status]
create_options.version = 3;
// create_options.v.v3.connstr = "couchbase://127.0.0.1:8091/travel-sample";
// create_options.v.v3.connstr = "couchbase://127.0.0.1/travel-sample";
create_options.v.v3.connstr = "couchbase://localhost/travel-sample";
create_options.v.v3.username = "Administrator";
create_options.v.v3.passwd = "secret";
lcb_create(&instance, &create_options);
lcb_wait(instance);
if (lcb_get_bootstrap_status(instance) != LCB_SUCCESS) {
printf("Error: %s", lcb_strerror(instance, lcb_get_bootstrap_status(instance)));
}
}