I tried to install influxDB on my raspPI 3B+ (openhbianpi) using the openhabian-config tool. During this I several time was asked to create a password for different users. So far no problem.
But then I don’t know how to go ahead. I tried to follow this tutorial:
Connected to http://localhost:8086 version 1.7.2
InfluxDB shell version: 1.7.2
Enter an InfluxQL query
Then I wanted to create a database using following command:
CREATE DATABASE myDB
But I got this error:
ERR: unable to parse authentication credentials Warning: It is possible this error is due to not setting a database. Please set a database with the command “use <database>”.
ERR: unable to parse authentication credentials DB does not exist!
What I do not understand is what the opehabian-config tool is installing if choosing ‘InfluxDB+Grafana’.
Since it is asking me to enter several times a password I thought it will create some initial DB to work with. But it seems not.
I tried to change this file but Visual Studio code (on my Mac) won’t let ne change this file. I got permission error.
It offers the option ‘retry as sudo’ which I did. Then I entered the credentials of my openhabian user but the password is declined - I tried several times without success - username openhabian and passwort are correct since I use it to login via ssh as well.
Other files like e.g. influxdb.persist I can change and save without any problems.
It is really strange - how can I change this file now?
Change the file permissions manually or use the openhabian-config tool to fix permissions.
EDIT: Check what the permissions are with ls -al /etc/openhab2/services/influxdb.cfg you may need to change the owner as well.
If the owner:group is different than your other service files use sudo chown openhab:openhabian influxdb.cfg or however you have the user:group setup if not opehab:openhabian
I forgot to mention in my post above that you’ll need to connect via ssh or directly to make permission, owner, group changes. I’m sure you are aware of this but it’s been a few minutes with no reply so I’m just making sure.
Also, if you need assistance with the commands for any changes let me know.
I changed the group and user of the influxdb.cfg file and could delete the double entries.
Then I started influx CLI again and tried:
CREATE DATABASE myDB but again I get following error:
ERR: unable to parse authentication credentials
Warning: It is possible this error is due to not setting a database.
Please set a database with the command “use <database>”.
I also tried:
use myDB
ERR: unable to parse authentication credentials
DB does not exist!
and also
use openhab_db
ERR: unable to parse authentication credentials
DB does not exist!
As I understand the influxdb.cfg file has only to do with openHAB and not with influx CLI.
So changing of influxdb.cfg makes no difference - correct me if I am wrong.
For what reason the openhabin-config tool creates the different users - but not any default database which I can use?
I think you are correct I was just hopping it would help b/c I don’t see what the issue could be. I followed the same tutorial when I installed influx but didn’t have issues so I’m kinda guessing at this point.
This is an InfluxDB authentication error. I am not familiar with the openhabian setup but you need to have a user in InfluxDB that has the rights to create databases and usually you have to specify that user on the influx cli. Like this: influx -port 'xxxx' -username admin -password PASSWORD -host localhost
Sorry I tried all these solutions. I’m able to run Grafana with Darksky plugin, no problem, but unable to setup connexion with openhab_db.
First I launched openhabian-config and selected the option to install Grafana with influxdb. Carefully noted the login and password I used. Now in the CLI console, unable to lauch a basic command like SHOW DATABASES, in return I get:ERR: Autorization failed Warning, it is possible this error is due to not setting a database…
I also installed the InfluxDB Persistence in Openhabian. To be clear, I was sure the openhabian-script was doing everything about the rights. Running on Raspberry Pi3+ with latest 2.5.x dev. version.
One point, is the database name created by the script openhab_db? This is not mentioned somewere…
Any help appreciated!
Edit, found solution there InfluxDB+Grafana persistence and graphing