No connection could be made because the target machine actively refused it

influxdb

#1

Hello,

I installed influxdb through: pip install influxdb. Then I tried executing the following code in python:

import influxdb
client = influxdb.InfluxDBClient(host='localhost', port=8086)
client.create_database('exam')

But I came across the following error:

requests.exceptions.ConnectionError: HTTPConnectionPool(host=‘localhost’, port=8086): Max retries exceeded with url: /query?q=CREATE+DATABASE+%22exam%22 (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x000001DF4715D128>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it’,))

I tried disabling the firewall, but I still get the error. What seems to be the problem?


#2

Hi ,
have you started the influxd ?
Is your database up and running ?
can you connect using the influx cli ?
best regards ,


#3

No, the documentation didn’t cover that part. I figured it should start on its own. How do I do that?


#4

In windows , you can search for the influxd.exe and start it :wink:


#5

You are a life saver, thank you. Have a nice day.