1.明文密码
vim /etc/clickhouse-server/users.xml
找到下面的语句,增加明文密码
<password>123456789</password>
-
sha256密码
echo -n 123456789 | openssl dgst -sha256
(stdin)= 15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225
修改user.xml里对应的密码和标签
<password_sha256_hex>15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225</password_sha256_hex>
-
sha1密码
echo -n 123456789| openssl dgst -sha1 -binary | openssl dgst -sha1
(stdin)= cc67043c7bcff5eea5566bd9b1f3c74fd9a5cf5d
修改user.xml里对应的密码和标签
<password_double_sha1_hex>cc67043c7bcff5eea5566bd9b1f3c74fd9a5cf5d</password_double_sha1_hex>
重启服务
systemctl restart clickhouse-server
测试登录
clickhouse-client --password