MySQL error 1040: Too many connections

   KB 23877        Last updated on 2019-09-26  

(0 votes)


That specific error can manifest during different circumstances. Below are two examples of such occurrences:

$ /opt/zimbra/libexec/zmdbintegrityreport -r -v 
/opt/zimbra/common/bin/mysqlcheck: Got error: 1040: Too many connections when trying to connect 
$ /opt/zimbra/bin/zmmysqlstatus 
ERROR 1040 (HY000): Too many connections 
Error while running 'mysql --user=zimbra --password=******** --database=zimbra --batch --skip-column-names'. at /opt/zimbra/bin/zmmysqlstatus line 256.


1. Enter mysql command line:

$ mysql

2. Once inside confirm the current setting:

show variables like "max_connections";

3. Change the current setting with higher value:

set global max_connections = 200;

4. Restart:

$ mysql.server stop 
$ mysql.server start 

However after server restart these settings will be gone.

To make the change permanent:

1. Edit my.cnf file and under [mysqld] section change the max_connections value.

2. Restart:

$ mysql.server stop 
$ mysql.server start 

IMPORTANT: Increasing the connections will also increase the memory usage on the server. Make sure you have enough resources before applying these changes.

Verified Against: Zimbra Collaboration 8.7, 8.8.9, 8.8.12 Date Created: 7/10/2019
Article ID: Date Modified: 2019-09-26

Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Wiki/KB reviewed by SME1 SME2 COPY EDITOR Last edit by Teodor Vizirov
Jump to: navigation, search