问题描述
ClickHouse的版本:22.2.2.1
最开始通过RPM安装的时候,并没有设置过密码,但是首次通过客户端登陆的时候发现总是登陆不上去。于是按照网上普遍的解决办法:给默认的 default
用户设置密码(users.xml),但是设置后再次登陆依旧报这个错。
注:仔细看了下报错原因就能解决这个问题
Connecting to localhost:9000 as user default.
If you have installed ClickHouse and forgot password you can reset it in the configuration file.
The password for default user is typically located at /etc/clickhouse-server/users.d/default-password.xml
and deleting this file will reset the password.
See also /etc/clickhouse-server/users.xml on the server where ClickHouse is installed.
Code: 516. DB::Exception: Received from localhost:9000. DB::Exception: default: Authentication failed: password is incorrect or there is no user with such name. (AUTHENTICATION_FAILED)
默认用户的密码通常位于 /etc/clickhouse-server/users.d/default-password.xml
删除此文件将重置密码。
解决办法
移除default-password.xml
文件
cd /etc/clickhouse-server/users.d/
mv default-password.xml default-password.xml.bak