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
This statement removes a user from the TiDB system database. The optional keyword `IF EXISTS` can be used to silence an error if the user does not exist.
11
+
This statement requires the `CREATE USER` privilege.
11
12
12
13
## Synopsis
13
14
@@ -25,10 +26,10 @@ This statement removes a user from the TiDB system database. The optional keywor
25
26
mysql> DROP USER idontexist;
26
27
ERROR 1396 (HY000): Operation DROP USER failed for idontexist@%
27
28
28
-
mysql> DROP USER IF EXISTS idontexist;
29
+
mysql> DROP USER IF EXISTS 'idontexist';
29
30
Query OK, 0 rows affected (0.01 sec)
30
31
31
-
mysql> CREATE USER newuser IDENTIFIED BY 'mypassword';
32
+
mysql> CREATE USER 'newuser' IDENTIFIED BY 'mypassword';
32
33
Query OK, 1 row affected (0.02 sec)
33
34
34
35
mysql>GRANT ALL ON test.* TO 'newuser';
@@ -54,10 +55,10 @@ mysql> SHOW GRANTS FOR 'newuser';
54
55
+-------------------------------------+
55
56
1 row inset (0.00 sec)
56
57
57
-
mysql> DROP USER newuser;
58
+
mysql> DROP USER 'newuser';
58
59
Query OK, 0 rows affected (0.14 sec)
59
60
60
-
mysql> SHOW GRANTS FOR newuser;
61
+
mysql> SHOW GRANTS FOR 'newuser';
61
62
ERROR 1141 (42000): There is no such grant defined for user 'newuser'on host '%'
This statement triggers TiDB to reload the in-memory copy of privileges from the privilege tables. You should execute `FLUSH PRIVILEGES` after making manual edits to tables such as `mysql.user`. Executing this statement is not required after using privilege statements such as `GRANT` or `REVOKE`.
11
+
Executing this statement requires the `RELOAD` privilege.
This statement allocates privileges to a pre-existing user in TiDB. The privilege system in TiDB follows MySQL, where credentials are assigned based on a database/table pattern.
11
+
Executing this statement requires the `GRANT OPTION` privilege and all privileges you allocate.
11
12
12
13
## Synopsis
13
14
@@ -42,7 +43,7 @@ This statement allocates privileges to a pre-existing user in TiDB. The privileg
42
43
## Examples
43
44
44
45
```sql
45
-
mysql> CREATE USER newuser IDENTIFIED BY 'mypassword';
46
+
mysql> CREATE USER 'newuser' IDENTIFIED BY 'mypassword';
0 commit comments