skip to Main Content

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?

2

Answers


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

    Login or Signup to reply.
  2. 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'

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search