DbSchema for ClickHouse Database

DbSchema is a comprehensive tool for designing and managing ClickHouse databases. It provides powerful features, like visual schema design, team collaboration with Git, easy schema deployment, and interactive HTML5 documentation.

How to Connect to ClickHouse Database

Open DbSchema, then click "Connect to Database" on the Main Screen and choose your database system. DbSchema will automatically download the required JDBC driver. Connect to Database in DbSchema

I. Configure the Local Connection in DbSchema

  • Select 'Using Authentication' from the JDBC URL
  • Test the connection by pressing the 'Ping' button to see if the port 8123 is reachable.
  • Enter the database user (no password is nedeed), then click 'Connect'.
Local Connection in ClickHouse

For more details, read the Connection Dialog page.

Running a ClickHouse Server with Docker

The following command is used to start a ClickHouse server container using Docker. Here's what each part of the command does:

docker run -d --name clickhouse --ulimit nofile=262144:262144 -p 8123:8123 -p 9000:9000 -p 443:443 yandex/clickhouse-server
  • docker run: Starts a new container from the specified image.
  • -d: Runs the container in detached mode, allowing it to run in the background.
  • --name clickhouse: Assigns the name clickhouse to the container for easier reference.
  • --ulimit nofile=262144:262144: Sets the maximum number of open file descriptors to 262144, which is important for ClickHouse's performance.
  • -p 8123:8123: Maps port 8123 on the host machine to port 8123 in the container for HTTP interface access.
  • -p 9000:9000: Maps port 9000 on the host to port 9000 in the container for native client connections.
  • -p 443:443: Maps port 443 on the host to port 443 in the container for secure HTTPS connections.
  • yandex/clickhouse-server: Specifies the image of the ClickHouse server to use.

After running this command, the ClickHouse server will be accessible through the mapped ports for interacting with databases using the HTTP, native client, or HTTPS interfaces.

  • Troubleshoot Firewall Issues
  • If you encounter connection issues, it may be due to firewall settings. Read how to enable Firewall Connections.
    Remember to enable Windows Firewalls Firewalls & anti-viruses may block database connections.