Skip to content

update doc for max_user_connections.#19898

Merged
ti-chi-bot[bot] merged 20 commits intopingcap:masterfrom
joccau:max-user-connections
Mar 17, 2025
Merged

update doc for max_user_connections.#19898
ti-chi-bot[bot] merged 20 commits intopingcap:masterfrom
joccau:max-user-connections

Conversation

@joccau
Copy link
Copy Markdown
Contributor

@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
Signed-off-by: joccau <zak.zhao@pingcap.cn>
@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-beta.1 This PR/issue applies to TiDB v9.0-beta.1. and removed missing-translation-status This PR does not have translation status info. labels Feb 26, 2025
Co-authored-by: xixirangrang <hfxsd@hotmail.com>
@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 <zak.zhao@pingcap.cn>
@joccau
Copy link
Copy Markdown
Contributor Author

joccau commented Feb 26, 2025

/test pull-verify

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Feb 26, 2025

@Frank945946: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

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
Copy Markdown
Contributor 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
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)

Signed-off-by: joccau <zak.zhao@pingcap.cn>
@joccau joccau requested a review from dveeden February 28, 2025 03:20
Co-authored-by: Frank945946 <108602632+Frank945946@users.noreply.github.com>
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 28, 2025
@ti-chi-bot
Copy link
Copy Markdown

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.

Co-authored-by: xixirangrang <hfxsd@hotmail.com>
@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
Copy link
Copy Markdown
Collaborator

@qiancai qiancai left a comment

Choose a reason for hiding this comment

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

Rest LGTM

joccau and others added 3 commits March 14, 2025 12:59
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>
@hfxsd
Copy link
Copy Markdown
Collaborator

hfxsd commented Mar 17, 2025

/approve

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Mar 17, 2025

[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

Details 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

@ti-chi-bot ti-chi-bot bot added the approved label Mar 17, 2025
@ti-chi-bot ti-chi-bot bot merged commit 4f77c01 into pingcap:master Mar 17, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved 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-beta.1 This PR/issue applies to TiDB v9.0-beta.1.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants