-
Notifications
You must be signed in to change notification settings - Fork 710
Add description about user ATTRIBUTE #11084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
89a6a2d
Create information-schema-user-attributes.md
qiancai a1003a7
add translations
qiancai 4e342e3
Update sql-statements/sql-statement-create-user.md
qiancai 0a1651a
Update information-schema/information-schema-user-attributes.md
qiancai 3f21ae1
fix punctuations
qiancai 398a902
Merge branch 'user_attribute' of https://github.com/qiancai/docs into…
qiancai 45622af
Update information-schema/information-schema.md
CbcWestwolf cc0fcd3
Apply suggestions from code review
CbcWestwolf d4a298a
Merge branch 'user_attribute' of https://github.com/qiancai/docs into…
qiancai a91a685
align with the Chinese changes
qiancai 3032396
Update information-schema/information-schema-user-attributes.md
CbcWestwolf 826c0cb
Apply suggestions from code review
Oreoxmt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| --- | ||
| title: USER_ATTRIBUTES | ||
| summary: Learn the `USER_ATTRIBUTES` INFORMATION_SCHEMA table. | ||
| --- | ||
|
|
||
| # USER_ATTRIBUTES | ||
|
|
||
| The `USER_PRIVILEGES` table provides information about user comments and user attributes. This information comes from the `mysql.user` system table. | ||
|
|
||
| ```sql | ||
| USE information_schema; | ||
| DESC user_attributes; | ||
| ``` | ||
|
|
||
| ```sql | ||
| +-----------+--------------+------+------+---------+-------+ | ||
| | Field | Type | Null | Key | Default | Extra | | ||
| +-----------+--------------+------+------+---------+-------+ | ||
| | USER | varchar(32) | NO | | NULL | | | ||
| | HOST | varchar(255) | NO | | NULL | | | ||
| | ATTRIBUTE | longtext | YES | | NULL | | | ||
| +-----------+--------------+------+------+---------+-------+ | ||
| 3 rows in set (0.00 sec) | ||
| ``` | ||
|
|
||
| Fields in the `USER_ATTRIBUTES` table are described as follows: | ||
|
|
||
| * `USER`: The user name. | ||
| * `HOST`: The host from which the user can connect to TiDB. If the value of this field is `%`, it means that the user can connect to TiDB from any host. | ||
| * `ATTRIBUTE`: The comment and attribute of the user, which are set by the [`CREATE USER`](/sql-statements/sql-statement-create-user.md) or [`ALTER USER`](/sql-statements/sql-statement-alter-user.md) statement. | ||
|
|
||
| The following is an example: | ||
|
|
||
| ```sql | ||
| CREATE USER testuser1 COMMENT 'This user is created only for test'; | ||
| CREATE USER testuser2 ATTRIBUTE '{"email": "user@pingcap.com"}'; | ||
| SELECT * FROM information_schema.user_attributes; | ||
| ``` | ||
|
|
||
| ```sql | ||
| +-----------+------+---------------------------------------------------+ | ||
| | USER | HOST | ATTRIBUTE | | ||
| +-----------+------+---------------------------------------------------+ | ||
| | root | % | NULL | | ||
| | testuser1 | % | {"comment": "This user is created only for test"} | | ||
| | testuser2 | % | {"email": "user@pingcap.com"} | | ||
| +-----------+------+---------------------------------------------------+ | ||
| 3 rows in set (0.00 sec) | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.