Skip to main content

How to access InfluxDB credentials on Platform.sh

Comments

3 comments

  • Christian Cueni

    Thanks for sharing!

    I’m able to setup the database & tunnel to my InfluxDB, but whenever I’m trying to connect from my application or from the influx cli I get the following message:

    ERR: error authorizing query: create admin user first or disable authentication
    Warning: It is possible this error is due to not setting a database.
    Please set a database with the command "use <database>".
    

    Unfortunately there are no credentials in the relationship JSON. Is there a way to add some settings to the service.yaml or how is one able to connect a InfluxDB.

    Thanks!

    0
  • Nikola Kotur

    @chrigu for now, you have to create admin user yourself like this:

    curl http://influx.internal:<port>/query -X POST -F q="CREATE USER admin WITH PASSWORD 'admin' WITH ALL PRIVILEGES"
    

    We’re working on making this automatic and seamless, as with other services. It should be released rather soon.

    0
  • Christian Cueni

    Thanks! That exactly the information I was missing.

    Funnily enough it did not work when I used the curl command.

    I had to (after I started the tunnel)

    influx -host 127.0.0.1 -port 30000                                                                                                                                                              [7:13:48]
    Connected to http://127.0.0.1:30000 version 1.7.10
    InfluxDB shell version: v1.7.9
    > CREATE USER admin WITH PASSWORD 'admin' WITH ALL PRIVILEGES
    

    then to use the user

    influx -host 127.0.0.1 -port 30000 -username admin -password ''
    
    0

Please sign in to leave a comment.