When I try to connect to remote clickhouse db via clickhouse command line:$ clickhouse-client -h some_ip.com --port 8123 -u some_user --password some_password -d some_db
I get:
ClickHouse client version 18.12.17.
Connecting to database some_db at some_ip.com:8123 as user some_user.
Code: 102. DB::NetException: Unexpected packet from server some_ip:8123, another_ip (expected Hello or Exception, got Unknown packet)
However this:$ curl http://some_ip.com:8123
Returns:
Ok
How to connect to remote clickhouse db via clickhouse command line?
P.S. connection establishes well with IDE such as datagrip but not with ch command-line
To connect to ClickHouse with native TCP you need this information: The HOST and PORT: typically, the port is 9440 when using TLS, or 9000 when not using TLS. The DATABASE NAME: out of the box there is a database named default , use the name of the database that you want to connect to.
Run sudo ./clickhouse install to install ClickHouse system-wide (also with needed configuration files, configuring users etc.). Then run sudo clickhouse start commands to start the clickhouse-server and clickhouse-client to connect to it.
clickhouse-client work with server over TCP which binds on 9000 port, and datagrip works over HTTP protocol with port 8123.
You should:
$ clickhouse-client -h some_ip.com --port 9000 -u some_user --password some_password -d some_db
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With