Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: TiSpark开启鉴权时,报Failed to get pd addresses from TiDB, please make sure user has PROCESS
privilege on INFORMATION_SCHEMA
.CLUSTER_INFO
TiDB version: 7.1.2
TiSpark version: [tispark-assembly-3.3_2.12-3.2.2.jar]
Same issue as this: tispark开启了tidb鉴权,使用spark-shell查询tidb数据时提示java.lang.IllegalArgumentException: Failed to get pd addresses from TiDB, please make sure user has `PROCESS` privilege on `INFORMATION_SCHEMA`.`CLUSTER_INFO` - TiDB 的问答社区
What I want to ask is, if the issue is due to lack of permissions on the INFORMATION_SCHEMA
.CLUSTER_INFO
table, how can I grant the necessary permissions? I found that except for the root user, other users do not have permissions. I tried using grant select on INFORMATION_SCHEMA.CLUSTER_INFO to 'user'
, but it didn’t work. Querying this table still results in 1227 - Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
.
I checked the documentation,
Prerequisites
- The database’s user account must have the
PROCESS
privilege.
So it is a problem of lacking the PROCESS privilege. However, when I tried to set the privilege, it reported 1221 - Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
. So how should I set the PROCESS privilege?
Did you perform the flush privileges; operation after granting permissions?
When granting permissions, you must first have the process privilege, and then grant other permissions. This is a characteristic of system views.
What user was used for authorization, what are the current user’s permissions, and what is the authorization statement?
show grants for the current user to check the current user’s permissions
We generally use grant all privileges.
I have already solved this problem. The PROCESS privilege can only be global, so you can only use grant process on *.* to 'test'@'%';
. You can only write . here, otherwise, it will report 1227 - Access denied; you need (at least one of) the PROCESS privilege(s) for this operation.
That’s right, it’s the same as MySQL, and there’s no risk, so you can grant it with confidence.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.