Home > Software engineering >  Clickhouse cannot login in 8123
Clickhouse cannot login in 8123

Time:10-20

have a problem with authorization in clickhouse, my os Ubuntu 18.04. I can connect with clickhouse-client.

clickhouse-client --user=dev --password=dev123
<jemalloc>: Number of CPUs detected is not deterministic. Per-CPU arena disabled.
ClickHouse client version 22.8.5.29 (official build).
Connecting to localhost:9000 as user dev.
Connected to ClickHouse server version 22.8.5 revision 54460.

But if i try connect to web - i get error.

curl http://localhost:8123/?user=dev&password=dev123

Code: 516. DB::Exception: dev: Authentication failed: password is incorrect or there is no user with such name. (AUTHENTICATION_FAILED) (version 22.8.5.29 (official build))

What is the problem with authorization on port 8123? Do I need to create a specific user for access, or do I need to somehow add rights to connect?

CodePudding user response:

I agree with the Geoff's comment, pretty sure this is due to not having quote around the url and the '&' caused the second part being treated as another shell command. Try:

curl 'http://localhost:8123/?user=dev&password=dev123'

if not, you can try basic auth as alternative?

curl -u 'dev:dev123' 'localhost:8123?query=SELECT 1'

CodePudding user response:

Try using ufw to open the port. If ufw doesn't work you can try using iptables.

  • Related