v.22.3New Feature

Allow Default User and Password for ClickHouse Client via Environment Variables

Allow getting default user and password for clickhouse-client from the CLICKHOUSE_USER and CLICKHOUSE_PASSWORD environment variables. Close #34538. #34947 (DR).
Allow clickhouse-client to obtain the default user and password credentials from the CLICKHOUSE_USER and CLICKHOUSE_PASSWORD environment variables.

Why it matters

This feature enables users to securely provide default authentication credentials to clickhouse-client via environment variables instead of specifying them directly in command line arguments or configuration files, improving security and convenience in automated or scripted environments.

How to use it

Set the environment variables CLICKHOUSE_USER and CLICKHOUSE_PASSWORD in your shell or environment before running clickhouse-client. The client will automatically use these values as defaults for authentication.

Example:
export CLICKHOUSE_USER=myuser
export CLICKHOUSE_PASSWORD=mypassword
clickhouse-client