couchbase cbc failed to bootstrap instance - couchbase

running below command
cbc n1ql 'SELECT * FROM `travel-sample`'
Throws exception below
Failed to bootstrap instance. libcouchbase error: Authentication failed. You may have provided an invalid username/password combination (0x2)
I am referring to documentation located at
https://docs.couchbase.com/server/5.5/sdk/development-intro.html

You need to supply a username/password to get access to use the travel-sample bucket. Try using your admin user to get started. Later, you can create a user with specific permissions on travel-sample.
If you just enter "cbc" it should dump the set of valid options, letting you find the options to use to supply the username and password.

Related

CAS not connected to Mysql for user authentication

I'm new to CAS.
I like to authenticate user to the list of users inside the Mysql database. I have included this line of code in the build.gradle file
implementation "org.apereo.cas:cas-server-support-jdbc:${project.'cas.version'}"
Here is the table defination in Mysql.
I have setup an instance of CAS 6.4 in Ubuntu server, disabled static user authentication and configure the /etc/cas/config/cas.properties to use Mysql as data source for authentication as config below, all other settings leave as default:
server.name=https://id.example.com
server.prefix=${cas.server.name}/
server.context-path=/ server.port=443
server.ssl.key-store=file:/etc/cas/theKeystore
server.ssl.key-store-password=theKeystorePassword
server.ssl.key-password=thePassword
logging.config=file:/etc/cas/config/log4j2.xml
cas.authn.accept.enabled=false
cas.authn.jdbc.query[0].driver-class: com.mysql.jdbc.Driver
cas.authn.jdbc.query[0].field-password: password
cas.authn.jdbc.query[0].password: theDBPassword
cas.authn.jdbc.query[0].sql: SELECT * FROM users WHRE uid=?
cas.authn.jdbc.query[0].url: jdbc:mysql://localhost:3306/cas?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
cas.authn.jdbc.query[0].user: theDBUser
I have set global general_log on Mysql to ON to trace any connection attempt. However, it seems the CAS server never try to connect to the Mysql server. On user site, they simply received attempt failed message on login page.
Is there anything I've missed?
It seems that instead of using
com.mysql.jdbc.Driver
I need to use
com.mysql.cs.jdbc.Driver
as driver-class.

Google Cloud SQL - Catch bad logins

I have an existing MySQL (version 5.7) instance hosted (managed) by Google Cloud SQL. I want to get a notification when someone is trying to connect my database with a bad username\password.
My idea was to look for it on the Google Stackrive logs, but it's not there.
There is an option to collect this information?
UPDATE 1:
I tried to connect the instance with gcloud but unfortunately, it's not working.
$ gcloud sql connect mydb
Whitelisting your IP for incoming connection for 5 minutes...done.
ERROR: (gcloud.sql.connect) It seems your client does not have ipv6 connectivity and the database instance does not have an ipv4 address. Please request an ipv4 address for this database instance.
It's because the database is accessible only inside the internal network. I searched for flags like --internal-ip but didn't find one.
However, I was guessing that it's not making any difference if I'll try to access the database from my DB editor (workbench). So I did it:
Searching for the query that #Christopher advised - but it's not there.
What I missed?
UPDATE 2:
Screenshot of my Stackdrive:
Even if I remove this (resource.labels.database_id="***") condition - the result is the same.
There is an option to collect this information?
One of the best options to collect information about who is trying to connect to your Google Cloud SQL instance with wrong credentials is Stackdriver Logging.
Before beginning
To reproduce this steps, I connected to the Cloud SQL instance using the gcloud command:
gcloud sql connect [CLOUD_SQL_INSTANCE]
I am not entirely sure if using the mysql command line something will change along the lines, but in case it does, you should only look for the new log message, and update the last boolean entry (from point 4 on).
How to collect this information from Stackdriver Logging
Go under Stackdriver → Logging section.
To get the information we are looking for, we will use advanced log queries. Advanced log queries are expressions that can specify a set of log entries from any number of logs. Advanced logs queries can be used in the Logs Viewer, the Logging API, or the gcloud command-line tool. They are a powerful tool to get information from logs.
Here you will find how to get and enable advanced log queries in your logs.
Advanced log queries are just boolean expressions that specify a subset of all the log entries in your project. To find out who has enter with wrong credentials into your Cloud SQL instance running MySQL, we will use the following queries:
resource.type="cloudsql_database"
resource.labels.database_id="[PROJECT_ID]:[CLOUD_SQL_INSTANCE]"
textPayload:"Access denied for user"
Where [PROJECT_ID] corresponds to your project ID and [CLOUD_SQL_INSTANCE] corresponds to the name of the Cloud SQL instance you would like to supervise.
If you notice, the last boolean expression corresponding to textPayload uses the : operator.
As described here by using the : operator we are looking for matches with any sub string in the log entry field, so every log that matches the string specified, which in this case is: "Access denied for user".
If now some user enters the wrong credentials, you should see a message like the following appear within your logs:
[TIMEFRAME][Note] Access denied for user 'USERNAME'#'[IP]' (using password: YES)
From here is a matter of using one of GCP products to send you a notification when a user enters the wrong credentials.
I hope it helps.
As said in the GCP documentation :
Cloud Shell doesn't currently support connecting to a Cloud SQL instance that has only a private IP address.

Error No. 2058 Plugin authentication_windows_client could not be loaded: The specified module could not be found

MySQL has a plugin that allows user authentication against current user’s Windows credentials. The plugin is ‘authentication_windows.dll’.
I get the following error message from SQLyog:
Error No. 2058 Plugin authentication_windows_client could not be
loaded: The specified module could not be found.
The “authentication_windows_client” is a dll that is supposed to be loaded on the client side. Actually I think that SQLyog is looking for an older dll which has been replaced by MySQL with ‘libmysql.dll’.
How do I make SLQyog load the correct dll?
Sqlyog included clear text and dialog plugin but due to license issue the are not able to support window authentication plugin.
so either you may purchase the product or go for crack otherwise you cannot use sqlyog along side with mysql until someone is not cracking...
Error analysis
Error information translation:
"Plug-in Cache - SHA2_ Password Unable to load"
The reason is that the SQLYOG failed to correctly parse the use of the mysql password encryption method.
Solution
Log in to mysql in the CMD command line (need to configure environment variable in advance), perform the following code
Connect MySQL sheel to localserver
\connect root#localhost
ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password BY 'your password';
This is for the root account, if other accounts also have the same problem, modify to correspond to the username and password, execute the statement

kamailio fails to start because of invalid database credentials

I'm trying to try my hand out with Kamailio and Freeswitch.
I'm following the article listed here:
http://nil.uniza.sk/sip/kamailio-33-and-freeswitch-122-interconnection-voicemail-and-conference-services-debian-squeeze-60-64bit-tutorial
After adding the #!define statements, the article says to try to restart kamailio. When I do that, it fails with the error:
driver error: Access denied for user 'kamailio'#'localhost' (using password: YES)
I'm not sure which configuration file would contain the name of the default user that's used to log in to mysql. I did make the recommended changes to kamctlrc where you define the dbhost, dbname and the read write user etc. But none of those settings made reference to this user "kamailio". Not sure where to check.
Thanks.
Upon closer examination, I found that not only do I have an /etc/kamailio/kamailio.cfg file but /etc/kamailio/kamailio-advanced.cfg.
I made the changes the article suggested for kamailio.cfg in kamailio-advanced.cfg instead... and all is well. I was able to start the service again. I'm not sure if the database will work but at least I'm one step closer and now authentication is working.

mysql on ec2 amazon instance attempting to login with incorrect user

I've set up a very basic LAMP setup on an ec2 server, all good it seems to work.
However i've seen for some queries a failure to connect to the mysql server with the following error:
[07-Jul-2013 20:15:41 Australia/Sydney] PHP Warning: mysql_real_escape_string(): Access denied for user 'ec2-user'#'localhost' (using password: NO) in /var/www/html/mycobber/class/sql/SqlQuery.class.php on line 40
[07-Jul-2013 20:15:41 Australia/Sydney] PHP Warning: mysql_real_escape_string(): A link to the server could not be established in /var/www/html/xxx/xxxx/sql/SqlQuery.class.php on line 40
the thing i dont' understand is the fact that in no location in my mysql connection configuration does it specify the user ec2-user. this is the default user when I log onto the unix server. I've set up a separate account to actually run all my processes, i dont' even use the es2-user.
I've looked online and can't see anything to explain this. does anyone have an idea what's going on here. it's not all the time
Your can't call mysql_real_escape_string without having opened a connection with mysql_connect first.
Quoting from the documentation:
A MySQL connection is required before using mysql_real_escape_string() otherwise an error of level E_WARNING is generated, and FALSE is returned.
The error message refers to your default username # localhost because you haven't opened a connection with specific credentials yet - it doesn't know what account details to use.