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.
The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.
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:
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!