# Influx, unable to connect to CLI with version 2

**URL:** <https://community.influxdata.com/t/influx-unable-to-connect-to-cli-with-version-2/26618>\
**Category:** InfluxDB 2\
**Created:** [September 19, 2022, 10:08am UTC](https://community.influxdata.com/t/influx-unable-to-connect-to-cli-with-version-2/26618 "2022-09-19T10:08:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bnevintel](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@bnevintel](https://community.influxdata.com/u/bnevintel)\
**Post date:** [September 19, 2022, 10:08am UTC](https://community.influxdata.com/t/influx-unable-to-connect-to-cli-with-version-2/26618/1 "2022-09-19T10:08:24Z")

</div>

Have installed influxdb and the cli from Ubuntu repo

However, unable to connect to the databases. When I type influx, I just get a list of the commands  
root@SM-icxd-25-1-3:~# influx  
NAME:  
influx - Influx Client

USAGE:  
influx [command]

COMMANDS:  
version Print the influx CLI version  
write Write points to InfluxDB  
bucket Bucket management commands  
completion Generates completion scripts  
query Execute a Flux query  
config Config management commands  
org, organization Organization management commands  
delete Delete points from InfluxDB  
user User management commands  
task Task management commands  
telegrafs List Telegraf configuration(s). Subcommands manage Telegraf configurations.  
dashboards List Dashboard(s).  
export Export existing resources as a template  
secret Secret management commands  
v1 InfluxDB v1 management commands  
auth, authorization Authorization management commands  
apply Apply a template to manage resources  
stacks List stack(s) and associated templates. Subcommands manage stacks.  
template Summarize the provided template  
bucket-schema Bucket schema management commands  
ping Check the InfluxDB /health endpoint  
setup Setup instance with initial user, org, bucket  
backup Backup database  
restore Restores a backup directory to InfluxDB  
remote Remote connection management commands  
replication Replication stream management commands  
server-config Display server config  
help, h Shows a list of commands or help for one command

GLOBAL OPTIONS:  
–help, -h show help

This is with the following version:

root@SM-icxd-25-1-3:~# influx version  
Influx CLI 2.3.0 (git: 88ba346) build\_date: 2022-04-06T19:30:53Z

My understanding is that it should connect to localhost:8086 and give a prompt. On another system I have with a earlier version of InfluxDB, this works as expected

root@silpixa00400863:~# influx  
Connected to [http://localhost:8086](http://localhost:8086) version 1.8.9  
InfluxDB shell version: 1.8.9

> show databases  
> name: databases  
> name

* * *

\_internal  
collectd  
telegraf

> exit

The version here is 1.8.9

root@silpixa00400863:~# influx -version  
InfluxDB shell version: 1.8.9

I would prefer not to have to use an earlier version, but I don’t see much option at the moment as I am unable to connect to and query the database.

Have I missed something?

---

<div class="post-metadata">

**Author:** ![Yevhenii\_Krainiukov](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/yevhenii_krainiukov/32/11018_2.png) [@Yevhenii\_Krainiukov](https://community.influxdata.com/u/Yevhenii_Krainiukov)\
**Post date:** [September 19, 2022, 1:10pm UTC](https://community.influxdata.com/t/influx-unable-to-connect-to-cli-with-version-2/26618/2 "2022-09-19T13:10:25Z")

</div>

Different versions InfluxDB, different behavior:  
for 2.x cli - [influx - InfluxDB command line interface | InfluxDB OSS 2.4 Documentation](https://docs.influxdata.com/influxdb/v2.4/reference/cli/influx/)  
for 1.x cli - [influx - InfluxDB command line interface | InfluxDB OSS 1.8 Documentation](https://docs.influxdata.com/influxdb/v1.8/tools/influx-cli/)  
In version 2.x you cannot write InfluxQL query.

---

<div class="post-metadata">

**Author:** ![bnevintel](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@bnevintel](https://community.influxdata.com/u/bnevintel)\
**Post date:** [September 19, 2022, 1:24pm UTC](https://community.influxdata.com/t/influx-unable-to-connect-to-cli-with-version-2/26618/3 "2022-09-19T13:24:55Z")

</div>

Thanks!

I have scripts written to query 1.x version, so I don’t want to have to re-write everything again

Is it possible to obtain the 1.8 version still? All the links on the official site point to the new 2.x version

The version is not overly important to me (other than the ability to be able to query it like before)

---

<div class="post-metadata">

**Author:** ![scott](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/scott/32/16492_2.png) [@scott](https://community.influxdata.com/u/scott)\
**Post date:** [September 20, 2022, 3:59pm UTC](https://community.influxdata.com/t/influx-unable-to-connect-to-cli-with-version-2/26618/4 "2022-09-20T15:59:24Z")

</div>

@bnevintel If you upgrade both InfluxDB and the CLI to 2.4+, you have access to an InfluxQL shell similar to the one in 1.8 with the [`influx v1 shell` command](https://docs.influxdata.com/influxdb/v2.4/reference/cli/influx/v1/shell/).
