4

I'm new to clickhouse and trying to get started. I've installed all the packages needed to be able to use it on my computer (ubuntu 16.04) but when I use the clickhouse-client command I get the following:

ClickHouse client version 20.3.4.10 (official build).
Connecting to localhost:9000 as user default.
Code: 516. DB::Exception: Received from localhost:9000. DB::Exception: default: Authentication failed: password is incorrect or there is no user with such name.

Do anyone know what I should do?

vladimir
  • 13,428
  • 2
  • 44
  • 70
qer
  • 73
  • 2
  • 10
  • 3
    It needs to pass user and password - *clickhouse-client --password your_password --user default* (see base options - https://clickhouse.tech/docs/en/interfaces/cli/#command-line-options). – vladimir Mar 26 '20 at 10:53
  • When you install CH you entered a default's password. It saved in /etc/clickhouse-server/users.d/default-password.xml . You can remove this file. – Denny Crane Mar 26 '20 at 13:21
  • That's because the first time you installed ClickHouse you have entered the default password and you need to provide it now. Check this example https://theflashreads.com/clickhouse-code-516-dbexception – Zoran Pandovski Nov 28 '20 at 13:42

2 Answers2

5

Find the Password here:

Open the terminal and run:

sudo nano /etc/clickhouse-server/users.d/default-password.xml

Source : https://clickhouse.tech/docs/en/operations/configuration-files/

David Buck
  • 3,752
  • 35
  • 31
  • 35
Velkumaran A P
  • 114
  • 1
  • 4
0

That's because the first time you installed ClickHouse you have entered the default password so you must provide that one as an argument to the clickhouse-client e.g

clickhouse-client --password=your-password 

reference