Reference:

www.tqwba.com/x_d/jishu/3…

Hub.docker.com/r/yandex/cl…

Docker command deployment

  1. Run the ClickHouse container
docker run -d --name clickhouse-server --ulimit nofile=262144:262144 \
-p 8123:8123 -p 9000:9000 -p 9009:9009 yandex/clickhouse-server
Copy the code

  1. Into the container
docker exec -it clickhouse-server /bin/bash
Copy the code

  1. Modify the configuration
  • Because you need to modify the configuration file, you need to install Vim
apt-get update
apt-get install vim -y
Copy the code
  • Changing the clickhouse user password needs to be configured in /etc/clickhouse-server/users.xml. Since the password must be encrypted, we encrypted it before changing it. Our example password uses 123456
PASSWORD=$(base64 < /dev/urandom | head -c8); echo "123456"; echo -n "123456" | sha256sum | tr -d '-'
Copy the code
  • The plaintext and ciphertext obtained are respectively
123456
8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92
Copy the code
  • Change the password. The < password > < / password > to < password_sha256_hex > 8 d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92 < / password_ sha256_hex>
vim /etc/clickhouse-server/users.xml
Copy the code

  1. The login
  • Use client connection and the user name is default
Clickhouse-client -h 127.0.0.1 -d default -m -u default --password '123456'Copy the code
  • If the following information is displayed, the login succeeds
ClickHouse client version 21.5.5.12 (official build).
Connecting to database default at 127.0.0.1:9000 as user default.
Connected to ClickHouse server version 21.5.5 revision 54448.
Copy the code

Use a DBeaver connection

1. Visualization tool DBeaver download

  • DBeaver’s official website dbeaver. IO/Download /


  1. Install after download
  • The default installation is ok, which will be skipped here

  1. The connection
  • Create a clickHouse connection

  • Fill in the parameters

  • Clicking the test link automatically downloads the ClickHouse driver

  • If the link fails after downloading, it is probably because the driver is not fully downloaded. In this case, you can forcibly download the driver again. If the link is successful, this step can be ignored

  • The connection is successful