You can try 3 things:
try to deletemy-clickhouse/user.d/allow_only_from_localhost.xml
config. Now, the user default
can connect from any ip (caution).
check the tcp port
with
clickhouse extract-from-config --config-file "$CLICKHOUSE_CONFIG" --key=tcp_port
by default it is 9000.
Then try connecting to the correct tcp port
clickhouse-client --port 9000
ClickHouse client version 21.8.15.7.
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 21.8.15 revision 54449.
c6d6dd1623a5 :)
- If you are using the docker image
yandex/clickhouse-server
, you can try to add my-clickhouse/config.d/docker_related_config.xml
config.
<yandex>
<!-- Listen wildcard address to allow accepting connections from other containers and host network. -->
<listen_host>::</listen_host>
<listen_host>0.0.0.0</listen_host>
<listen_try>1</listen_try>
<!--
<logger>
<console>1</console>
</logger>
-->
</yandex>
then in your .dockerfile
:
FROM yandex/clickhouse-server:latest
COPY config.d/* /etc/clickhouse-server/config.d/