Number of MySQL max connections under CentOS Setup 1040 too many connection

Source: Internet
Author: User

The "1040 Too many Connection" error may occur when the maximum number of connections is more than an hour.

Can change the configuration file to change the maximum number of connections, but I even do not know where the configuration file, what should I do?

First, you need to restart the MySQL service, run the command: service MySQL restart

It may also be: Service mysqld restart

Login Mysql:mysql-uroot-p
input password, 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 change the maximum number of connections:

Set global max_connections = 3600;

Note: This method only temporarily changes the maximum number of connections, and once again starts the MySQL service and then restores.

To solve this problem:

To completely solve this problem or to change the MY.CNF configuration file, here use VI to change, enter the command: VI/USR/MY.CNF return, open the file and press "I" key to enter the editing state;

Join "[mysqld]" below? " max_connections=3600 ", press ESC to enter command mode, enter": Wq "carriage return (save and exit).

Running: Service MySQL Restart again starts MySQL services;

Note: Very many articles mention "[Mysqld]" under "Add"? Set -variable=max_connections= + "No, not at all, after adding the service will not start."

My environment is: CentOS 6.5 MySQL 5.6


Maximum number of MySQL connections under CentOS Setup 1040 too many connection

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.