ERROR 1040 (HY000): Too many connections indicates that mysql has more than one connection
The first solution (not recommended) :
Need to wait for a period of time (quite long), let the existing connection timeout automatically released; Or restart mysql (CentOS7: SystemCTL Restart Mysqld.Service)
The second option (use with caution) :
Login to mysql: mysql-uroot-p your root password
Look at the maximum number of connections mysql is currently setting. In general, the default number of connections to mysql is over 100, and the maximum number can be set to 16384 (2 ^ 14)
show variables like ‘%max_connections%’;
Set the maximum number of connections as needed, so I’m going to set 1000 here
set GLOBAL max_connections = 1000;
Note: This is used with caution because once the server or mysql service is restarted, the Settings will not take effect and the default Settings will be restored
The third option (the conditions allow the recommended use) :
Add or modify the max_connections parameter in the mysql configuration file
Linux (centos7) environment:
Windows environment:
Find my.ini in the installation directory. If you don’t have it, find My-default.ini, make a copy and rename it my.ini. Add or modify the max_connections parameter
After setting parameters, restart mysql service.
Resources:
FAQ for Installing Mysql5.7 and mysql under Linux(Centos7)
The first solution (not recommended) :
Need to wait for a period of time (quite long), let the existing connection timeout automatically released; Or restart mysql (CentOS7: SystemCTL Restart Mysqld.Service)
The second option (use with caution) :
Login to mysql: mysql-uroot-p your root password
Look at the maximum number of connections mysql is currently setting. In general, the default number of connections to mysql is over 100, and the maximum number can be set to 16384 (2 ^ 14)
show variables like ‘%max_connections%’;
Set the maximum number of connections as needed, so I’m going to set 1000 here
set GLOBAL max_connections = 1000;
Note: This is used with caution because once the server or mysql service is restarted, the Settings will not take effect and the default Settings will be restored
The third option (the conditions allow the recommended use) :
Add or modify the max_connections parameter in the mysql configuration file
Linux (centos7) environment:
Windows environment:
Find my.ini in the installation directory. If you don’t have it, find My-default.ini, make a copy and rename it my.ini. Add or modify the max_connections parameter
After setting parameters, restart mysql service.
Resources:
FAQ for Installing Mysql5.7 and mysql under Linux(Centos7)
Read More:
- Sorting out MySQL “too many connections” solutions
- ERROR 1040 (08004): Too many connections
- Using the TP framework, an error is reported sqlstate [08004] [1040] too many connections
- PHP message: PHP Fatal error: Uncaught PDOException: SQLSTATE[08004] [1040] Too many connections
- failed to open stream: HTTP wrapper does not support writeable connections
- The command Du – h — max depth = 1 in Linux
- ERROR: Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-install-zsbbp6ce/mysq
- Java long type error: error: integer number too large
- Solution to error 2002 (HY000) in MySQL login startup
- Docker starts MySQL container and reports an error driver failed programming external connectivity on endpoint mysq
- Solution to error 2002 (HY000) in MySQL
- socket.error : [errno 10048] and view PID process number and port number
- Analysis of [error code [942], ora-00942 in synchronization of DDL statements in ogg
- MySQL error 1205 (HY000): lock wait timeout exceeded; try restarting transaction
- Analysis of the causes of errors in G + + compilation “was not declared in this scope”“
- Solution to the warning of too low TDR value in new sp
- About error 1005 (HY000) in MySQL: can’t create table ‘_______ ‘(errno: 150) fool’s plan
- IIS “Bad Request – Request Too Long. HTTP Error 400. The size of the request headers is too long.”
- Analysis and solution of common errors in ArcEngine development
- [Solved] CAP_IMAGES: can‘t find starting number (in the name of file)