You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e2a4749
Browse filesBrowse the repository at this point in the historyBrowse files
### How to create default database and user on starting
201
203
202
-
Sometimes you may want to create a user (user named `default` is used by default) and database on a container start. You can do it using environment variables `CLICKHOUSE_DB`, `CLICKHOUSE_USER`, `CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT` and `CLICKHOUSE_PASSWORD`:
204
+
Set `CLICKHOUSE_DB` to create a database when the container first initializes the data directory. Set `CLICKHOUSE_USER` and `CLICKHOUSE_PASSWORD` to configure a user. If you omit `CLICKHOUSE_USER`, the image uses the `default` user.
205
+
206
+
`CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1` lets the configured user create users and grant privileges. In the example below, this is `username`. When you set a non-default username or a password, SQL access management is disabled if you omit this variable or set it to `0`.
The user `default` has disabled network access by default in the case none of `CLICKHOUSE_USER`, `CLICKHOUSE_PASSWORD`, or `CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT` are set.
214
+
With the stock configuration, if you use the `default` user without a password and leave `CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT` unset or set it to `0`, the user retains SQL access management and can connect only from localhost.
211
215
212
-
There's a way to make `default` user insecurely available by setting environment variable `CLICKHOUSE_SKIP_USER_SETUP` to 1:
216
+
`CLICKHOUSE_SKIP_USER_SETUP=1` skips user configuration even if you set a username, password, or access-management flag. With the stock configuration, this allows network connections as the `default` user without a password.
213
217
214
218
```bash
215
219
docker run --rm -e CLICKHOUSE_SKIP_USER_SETUP=1 -p 9000:9000/tcp clickhouse
0 commit comments