Clickhouse grant add user error
问题
Clickhouse使用Grant给用户添加权限
1 | GRANT SELECT, INSERT ON |
遇到异常
1 | Code: 495. DB::Exception: Received from localhost:9000. DB::Exception: There was an error on [xx-host.com:9000]: Code: 495. DB::Exception: Cannot update user `read_user01` in users_xml because this storage is readonly. (ACCESS_STORAGE_READONLY) (version 24.10.2.80 (official build)). (ACCESS_STORAGE_READONLY) |
原因
read_user01
是在 /etc/clickhouse-server/user.d/user.xml
中配置的,无法使用grant给该用户添加权限。
- 解决
在Clickhouse集群上,手动修改
/etc/clickhouse-server/user.d/user.xml
为用户添加权限
1 | <clickhouse> |
原因 user兼容性: 两种方法可以同时使用,但不能同时管理同一个访问实体。 这允许用户从基于文件的方法平滑过渡到SQL配置驱动的方法。
- Title: Clickhouse grant add user error
- Author: Ordiy
- Created at : 2025-03-31 14:42:19
- Updated at : 2025-04-17 10:06:43
- Link: https://ordiy.github.io/posts/2025-03-01-clickhouse-user-access-storage-readonly/
- License: This work is licensed under CC BY 4.0.