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
root@localhost:8001/default> show grants;
SHOW GRANTS
-[ RECORD 1 ]-----------------------------------
privileges: ALL
object_name: *.*
object_id: NULL
grant_to: USER
name: root
grants: GRANT ALL ON*.* TO 'root'@'%'1 row read in0.023 sec. Processed 1 row, 133B (43.34 rows/s, 5.63 KiB/s)
root@localhost:8001/default> show columns from clusters from system;
error: APIError: ResponseError with 1063: Permission denied: User 'root'@'%' does not have the required privileges for table 'system.clusters'
The text was updated successfully, but these errors were encountered:
Hey there, @TCeason! 👋 I'm here to help you with any bugs, questions, or contributions you have. I'm like a bot with a heart! 😄
The "show columns from clusters from system" SQL command returns a "Permission denied" error for the 'root' user because the user does not have the required privileges for the 'system' database. Even though the 'root' user is granted all available privileges on a global level, specific operations within the 'system' database may still require additional privileges [1].
To resolve this, you can explicitly grant the necessary privileges to the 'root' user for the 'system' database. Here is a code snippet to do that:
use databend_common_meta_app::principal::{GrantObject,UserPrivilegeType,UserGrantSet};use enumflags2::make_bitflags;letmut user = UserInfo::new_no_auth("root","%");letmut grants = UserGrantSet::empty();
grants.grant_privileges(&GrantObject::Database("system".to_string()),make_bitflags!(UserPrivilegeType::{Select | Insert | Update | Delete}).into(),);
user.grants = grants;
session.set_authed_user(user,None).await.unwrap();
This code grants the 'root' user the necessary privileges to access the 'system' database [2][3].
Summary
The text was updated successfully, but these errors were encountered: