Home > Database > Mysql Tutorial > A brief analysis of two methods for setting the maximum number of connections in mysql

A brief analysis of two methods for setting the maximum number of connections in mysql

青灯夜游
Release: 2022-07-12 11:03:04
forward
2966 people have browsed it

How to set the maximum number of connections in mysql? The following article will introduce to you two methods for setting the maximum number of connections in MySQL. I hope it will be helpful to you.

A brief analysis of two methods for setting the maximum number of connections in mysql

Usually, the default maximum number of connections for mysql is 100, and the maximum number can reach 16384; if we want to modify the maximum number of connections for mysql, how to set it? Take a look below.

Method 1: Command line modification

We only need to open the mysql console and enter the "set GLOBAL max_connections=1000;" statement to directly set the maximum connection Number, as shown in the figure below:

Note: This method does not cure the problem. It can only temporarily modify the maximum number of connections. If you restart mysql, the maximum number of connections will change again. Return to the originally set value.

Method 2: Modify the maximum number of connections through the mysql configuration file

1. Open the mysql installation directory on the computer and find the my.ini file, as shown below Shown:

2. Open the my.ini file with Notepad, find and modify the value of "max_connections", the default maximum number of connections It is 100, as shown in the figure below:

Set "max_connections=1000", so that the maximum number of mysql connections can be set to 1000.

3. After setting the maximum number of connections, you need to restart the mysql service

Go to [Computer]-->[Management]-->[Services and Applications] Program]-->[Service]-->[MySQL]

Click mysql and right-click to start or shut down, as shown in the following figure:

This sets the maximum number of mysql connections to 1000, and it is a permanent setting.

[Related recommendations: mysql video tutorial]

The above is the detailed content of A brief analysis of two methods for setting the maximum number of connections in mysql. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template