Skip to content
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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

joccau
Copy link
Member

@joccau joccau commented Feb 24, 2025

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).

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.4 (TiDB 8.4 versions)
  • v8.3 (TiDB 8.3 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)

What is the related PR or file link(s)?

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@ti-chi-bot ti-chi-bot bot added missing-translation-status This PR does not have translation status info. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 24, 2025
@joccau joccau force-pushed the max-user-connections branch from f91427c to a49b734 Compare February 24, 2025 14:58
@joccau joccau force-pushed the max-user-connections branch from a49b734 to b08ca9f Compare February 25, 2025 04:32
@hfxsd hfxsd added translation/doing This PR’s assignee is translating this PR. type/compatibility-or-feature-change This PR involves compatibility changes or feature behavior changes. v9.0 and removed missing-translation-status This PR does not have translation status info. labels Feb 26, 2025
Co-authored-by: xixirangrang <[email protected]>
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 26, 2025
@hfxsd hfxsd requested a review from Frank945946 February 26, 2025 03:18
Signed-off-by: joccau <[email protected]>
@joccau
Copy link
Member Author

joccau commented Feb 26, 2025

/test pull-verify

Copy link

ti-chi-bot bot commented Feb 26, 2025

@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.

@joccau
Copy link
Member Author

joccau commented Feb 27, 2025

/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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

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)

Copy link

ti-chi-bot bot commented Feb 28, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from hfxsd, ensuring that each of them provides their approval before proceeding. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@joccau joccau requested a review from dveeden February 28, 2025 03:20
Co-authored-by: Frank945946 <[email protected]>
@ti-chi-bot ti-chi-bot bot added the lgtm label Feb 28, 2025
@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 28, 2025
Copy link

ti-chi-bot bot commented Feb 28, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-26 03:17:22.701871365 +0000 UTC m=+412190.655029630: ☑️ agreed by hfxsd.
  • 2025-02-28 06:44:55.458155171 +0000 UTC m=+597443.411313421: ☑️ agreed by dveeden.

@hfxsd hfxsd requested a review from qiancai March 7, 2025 02:47
@hfxsd hfxsd added translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. and removed translation/doing This PR’s assignee is translating this PR. labels Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm size/M Denotes a PR that changes 30-99 lines, ignoring generated files. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. type/compatibility-or-feature-change This PR involves compatibility changes or feature behavior changes. v9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants