examples icon indicating copy to clipboard operation
examples copied to clipboard

Provide an example with Clickhouse username/password

Open kumarshantanu opened this issue 1 year ago • 1 comments

Please provide a simple docker-compose example where one can

  • Spin up a Clickhouse server locally
  • Database should be accessible using database name, username, password
  • User should be able to connect to it using a general-purpose database client, e.g. DBeaver or DbVisualizer

Currently, I am able to spin up the server using docker compose up but do not know how to configure database name, username, password. Even editing users.xml and re-running docker compose up does not help.

kumarshantanu avatar Jun 27 '24 13:06 kumarshantanu

After some hit and trial, I am able to connect to a local DB instance (recipe ch-1S_1K_IMDB_dataset) using DbVisualizer using the config below:

Database name: default Username: demouser (yes, the XML tag is the username) Password: secret (the text between the password XML tag) Filename: docker-compose-recipes/recipes/ch-1S_1K_IMDB_dataset/fs/volumes/clickhouse/etc/clickhouse-server/users.d/users.xml Replace the <default>...</default> snippet under <users> with the following:

      <demouser>
        <profile>default</profile>
        <networks>
          <ip>::/0</ip>
        </networks>
        <password>secret</password>
        <quota>default</quota>
      </demouser>

kumarshantanu avatar Jun 27 '24 13:06 kumarshantanu