-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
update doc for max_user_connections. #19898
base: master
Are you sure you want to change the base?
Conversation
f91427c
to
a49b734
Compare
Signed-off-by: joccau <[email protected]>
a49b734
to
b08ca9f
Compare
Co-authored-by: xixirangrang <[email protected]>
Signed-off-by: joccau <[email protected]>
/test pull-verify |
@Frank945946: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/cc @dveeden This PR is the Chinese doc, and I will make PR for English doc later. |
|
||
```sql | ||
ALTER USER 'newuser' WITH MAX_USER_CONNECTIONS 3; | ||
SELECT USER, HOST, MAX_USER_CONNECTIONS FROM MYSQL.USER WHERE USER='newuser'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SELECT USER, HOST, MAX_USER_CONNECTIONS FROM MYSQL.USER WHERE USER='newuser'; | |
SELECT User, Host, max_user_connections FROM mysql.user WHERE User='newuser'; |
The column names are stored with a specific case. While they should work when compared with any other case it is best to keep these identical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using system tables directly should be avoided.
So insert of this GRANT
, CREATE USER
, etc should be used.
In this case could SHOW CREATE USER...
or SHOW GRANTS FOR...
be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is following the same format as other examples.
I'm ok if this is changed for all examples in a separate PR some time later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is following the same format as other examples.
I'm ok if this is changed for all examples in a separate PR some time later.
Yes, It is used for showing the field max_user_connections
when creating user WITH MAX_CONNECTIONS N
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might be a better way than SELECT ... mysql.user...
:
mysql-8.0.11-TiDB-v9.0.0-alpha-340-gd392685> CREATE USER 'u1'@'%' IDENTIFIED BY 'really_really_secret' WITH MAX_USER_CONNECTIONS 123;
Query OK, 0 rows affected (0.03 sec)
mysql-8.0.11-TiDB-v9.0.0-alpha-340-gd392685> SHOW CREATE USER 'u1'@'%'\G
*************************** 1. row ***************************
CREATE USER for u1@%: CREATE USER 'u1'@'%' IDENTIFIED WITH 'mysql_native_password' AS '*D4EF4C5A994EF8283FB666D79DCADE5B6A764D4E' REQUIRE NONE WITH MAX_USER_CONNECTIONS 123 PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT
1 row in set (0.01 sec)
Signed-off-by: joccau <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Co-authored-by: Frank945946 <[email protected]>
Co-authored-by: Daniël van Eeden <[email protected]>
Co-authored-by: xixirangrang <[email protected]>
First-time contributors' checklist
What is changed, added or deleted? (Required)
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions (in Chinese).
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?