update doc for max_user_connections.#19898
Conversation
f91427c to
a49b734
Compare
Signed-off-by: joccau <zak.zhao@pingcap.cn>
a49b734 to
b08ca9f
Compare
Co-authored-by: xixirangrang <hfxsd@hotmail.com>
Signed-off-by: joccau <zak.zhao@pingcap.cn>
|
/test pull-verify |
|
@Frank945946: adding LGTM is restricted to approvers and reviewers in OWNERS files. DetailsIn 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.
| 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.
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.
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.
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.
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 <zak.zhao@pingcap.cn>
Co-authored-by: Frank945946 <108602632+Frank945946@users.noreply.github.com>
Co-authored-by: Daniël van Eeden <github@myname.nl>
Co-authored-by: xixirangrang <hfxsd@hotmail.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Daniël van Eeden <github@myname.nl>
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hfxsd The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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?