Set the maximum number of mysql connections in CentOS to 1040 too persistent connection and centosmysql.
When the maximum number of connections is small, the error "1040 too connection" may occur.
You can modify the configuration file to modify the maximum number of connections, but I don't know where the configuration file is. What should I do?
First, restart the mysql service and run the command: service mysql restart
It may also be: service mysqld restart
Log on to mysql: mysql-uroot-p
Enter the password and press Enter;
After successful logon, run the following statement to query the current maximum number of connections:
Select VARIABLE_VALUE from information_schema.GLOBAL_VARIABLES where VARIABLE_NAME = 'max _ CONNECTIONS ';
Run the following statement to modify the maximum number of connections:
Set global max_connections = 3600;
After mysql starts the service, it is creating a connection until the maximum number of connections is reached and the too many ons error is reported.
0 first, determine the number of mysql connections configuration, such as the production system, estimate the maximum number of connections, and configure my. ini/my. cnf
Show variables like '% max_connections % ';
1. log on to mysql using the root user and check the connection status every other time:
Show processlist;
Check that all clients are connected and whether these connections are valid clients. If not, use restrictions;
If yes, it indicates that the number of connections configured is small and the database server should be changed.
Mysql connection error: #1040-Too connector connections
Kill some connections
It is very likely that you have used multiple threads for connection. One function uses multiple threads for connection and there is no other solution.
Add connection Parameters