MySQL Variables max_user_connections 数据库 参数变量解释及正确配置使用

本站中文解释

max_user_connections:指定每个用户最大能连接SQl数据库的次数;

设置方法:

1. 在MySQL的安装conf文件夹中找到my.cnf文件;

2. 在文件中添加“max_user_connections=数值”参数;

3. 将文件保存并重新启动MySQL;

4. 运行以下命令以检查该参数是否被更改: SHOW GLOBAL VARIABLES LIKE ‘max_user_connections’;

官方英文解释

max_user_connections

Command-Line Format --max-user-connections=#
System Variable max_user_connections
Scope Global, Session
Dynamic Yes
Type Integer
Default Value 0
Minimum Value 0
Maximum Value 4294967295

The maximum number of simultaneous connections permitted to
any given MySQL user account. A value of 0 (the default) means
no limit.

This variable has a global value that can be set at server
startup or runtime. It also has a read-only session value that
indicates the effective simultaneous-connection limit that
applies to the account associated with the current session.
The session value is initialized as follows:

  • If the user account has a nonzero
    MAX_USER_CONNECTIONS resource limit,
    the session
    max_user_connections
    value is set to that limit.

  • Otherwise, the session
    max_user_connections
    value is set to the global value.

Account resource limits are specified using the
CREATE USER or
ALTER USER statement. See
Section 6.2.16, “Setting Account Resource Limits”.


数据运维技术 » MySQL Variables max_user_connections 数据库 参数变量解释及正确配置使用