Set the maximum number of mysql connections in CentOS to 1040 too persistent connection and centosmysql.

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.