Tag Archives: ERROR 1040 (HY000): Too many connections

[Solved] MYSQL Error 1040 (HY000): too many connections

Error 1040 (HY000): too many connections

the first processing method:

./mysql -u root -p

After successful login, execute the following statement to query the current maximum number of connections:

select VARIABLE_VALUE from information_schema.GLOBAL_VARIABLES where VARIABLE_NAME='MAX_CONNECTIONS';

Execute the following statement to modify the maximum number of connections:

set global max_connections = 10000;

You can view it through the following statement:

show variables like '%max_connections%';

The second way to handle it:

vim /etc/my.cnf

Under the paragraph [mysqld], add

max_connections=10000

It needs to be restarted to take effect

show full processlist; You can view some status

The first way is to take effect immediately in real time, but it will be restored to the original configuration after restart. The second way is to read the configuration file. The parameters here will be used when starting mysql, which is equivalent to permanent effect