gpt4 book ai didi

clickhouse - 如何为 Clickhouse 设置管理员帐户?

转载 作者:行者123 更新时间:2023-12-03 21:10:28 24 4
gpt4 key购买 nike

我在 Windows 主机上的 docker 容器中运行 Clickhouse。我尝试创建一个帐户以使其成为管理员帐户。看起来 默认 用户没有创建其他帐户的权限。如何解决此错误并创建管理员帐户?

docker-compose exec -T dash-clickhouse clickhouse-client --query="CREATE USER 'foo' IDENTIFIED WITH sha256_password BY 'bar'"
给出了错误
Received exception from server (version 20.7.2):
Code: 497. DB::Exception: Received from localhost:9000. DB::Exception: default: Not enough privileges. To execute this query it's necessary to have the grant CREATE USER ON *.*.

最佳答案

要修复它,需要在 users.xml 文件中启用 access_management -setting:

#  execute an interactive bash shell on the container
docker-compose exec {container_name} bash
# docker exec -it {container_name} bash

# install preferable text editor (i prefer using 'nano')
apt-get update
apt-get install nano

# open file users.xml in the editor
nano /etc/clickhouse-server/users.xml
取消注释默认用户的“access_management”设置并保存更改:
..
<!-- User can create other users and grant rights to them. -->
<!-- <access_management>1</access_management> -->
..

关于clickhouse - 如何为 Clickhouse 设置管理员帐户?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64166492/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com