Home  >  Article  >  Database  >  How to query the maximum number of connections in mysql

How to query the maximum number of connections in mysql

WBOY
WBOYOriginal
2022-03-31 16:05:5210928browse

In mysql, you can use the "show variables like '%max_connections%';" command to query the maximum number of connections in mysql; the show command is used to provide multiple forms of obtaining database information, and "max_connections" is used to indicate the maximum number of connections. Number of connections.

How to query the maximum number of connections in mysql

The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.

How to query the maximum number of connections in mysql

The query command is:

show variables like '%max_connections%';

The default maximum number of connections in MySQL is 100, which can be viewed using the above command on the mysql client

This command will get output similar to the following:

+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| max_connections | 1000 |
| max_user_connections | 1000 |
+----------------------+-------+

To modify the maximum number of connections of mysql, you only need to modify the value of max_connections in the my.cnf configuration file, and then restart mysql. If the max_connections entry is not found in the my.ini file, you can add the following entries yourself

max-connections = 1000
max_user_connections = 1000

Just restart Mysql!

The example is as follows:

How to query the maximum number of connections in mysql

How to query the maximum number of connections in mysql

Recommended learning: mysql video tutorial

The above is the detailed content of How to query the maximum number of connections in mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn