Recently i got “too many connections” errors in MySQL, after quick research i found a solution to fix this issue.This issue due to connection limit of my MySQL installation.We can change the max_connections setting to allow more connections.
For windows based systems you can find and set max_connections settings at my.ini file. For example in xampp you can find the file at c:/xampp/mysql/bin/my.ini
.place this line max_connections = 1000
and restart xampp.
For Linux based systems fallow the below steps :
Locate the file named my.cnf in your server:
find / -name my.cnf
Generally it is stored in the following location:
/etc/mysql/my.cnf
Edit the file with vim command and find the max_connections string:
vi /etc/my.cnf
Uncomment max_connections and increase the limit to 1000 connections:
max_connections = 1000
Restart mysql service:
/etc/init.d/mysql restart
That’s it.