"influx" connects to the wrong port

So I’m going to assume you’ve installed InfluxDB 1 through the system packages and manually installed InfluxDB 2.

I’d recommend you either rename or delete InfluxDB 2 (Assuming you want InfluxDB 1)

To do that, do:

# to rename
sudo mv /usr/local/bin/influx /usr/local/bin/influx2

# to delete
sudo rm -f /usr/local/bin/influx