The root account does not have alter grant permissions

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: root账号没有alter grant权限

| username: TiDBer_c2Ra1ghs

Bug Report
Clearly and accurately describe the issue you have found. Providing any steps to reproduce the problem can help the development team address the issue promptly.
[TiDB Version]
[Impact of the Bug]
Unable to grant alter permissions to any user. Checked the permissions of root, and the returned information is as follows:
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,PROCESS,REFERENCES,SHOW DATABASES,SUPER,EXECUTE,INDEX,CREATE USER,CREATE TABLESPACE,TRIGGER,CREATE VIEW,SHOW VIEW,CREATE ROLE,DROP ROLE,CREATE TEMPORARY TABLES,LOCK TABLES,CREATE ROUTINE,ALTER ROUTINE,EVENT,SHUTDOWN,RELOAD,FILE,CONFIG,REPLICATION CLIENT,REPLICATION SLAVE ON . TO ‘root’@‘%’ WITH GRANT OPTION

[Possible Steps to Reproduce the Issue]

[Observed Unexpected Behavior]

[Expected Behavior]

[Related Components and Specific Versions]

[Other Background Information or Screenshots]
Such as cluster topology, system and kernel version, application app information, etc.; if the issue is related to SQL, please provide SQL statements and related table schema information; if there are critical errors in the node logs, please provide the relevant node log content or files; if some business-sensitive information is inconvenient to provide, please leave contact information, and we will communicate with you privately.

| username: 有猫万事足 | Original post link

7.1.1 did not reproduce.

| username: TiDBer_c2Ra1ghs | Original post link

Is there any way I can solve this?

| username: 有猫万事足 | Original post link

Actually, I think you shouldn’t doubt such a basic function.
There is a high probability that there are other issues.

| username: Billmay表妹 | Original post link

You can try the following steps:

  1. Confirm whether the statement you are using is correct. In TiDB, the syntax for authorization statements is quite strict, and incorrect statements may lead to authorization failure.
  2. Confirm whether your user has the authorization privileges. In TiDB, authorization operations require a user with GRANT privileges.
  3. Confirm whether your TiDB version is correct. In early versions of TiDB, there might be some issues with permission checks. If your TiDB version is relatively old, you can try upgrading to the latest version to see if it resolves the issue.
| username: redgame | Original post link

No problem with this.

| username: tidb菜鸟一只 | Original post link

I tested it like this, the root permissions are not quite the same as what you showed.
image

| username: Miracle | Original post link

Has this root account been deleted and recreated?

| username: Fly-bird | Original post link

grant all privileges on *.* to test_alter@'%';
| username: zhanggame1 | Original post link

What version are you using? I tested it here and didn’t encounter any issues.

| username: 啦啦啦啦啦 | Original post link

This root account wasn’t automatically created during system initialization, right? Generally, the automatically created account has all permissions.

| username: 昵称想不起来了 | Original post link

Couldn’t reproduce it, feels like the account was deleted and recreated.

| username: TiDBer_vfJBUcxl | Original post link

Take a look at this to see if it helps: