MySQL ERROR 1040: Difference between revisions
(3 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
That specific error can manifest during different circumstances. Below are two examples of such occurrences: | |||
$ /opt/zimbra/libexec/zmdbintegrityreport -r -v | $ /opt/zimbra/libexec/zmdbintegrityreport -r -v | ||
Line 34: | Line 35: | ||
However after server restart these settings will be gone. | However after server restart these settings will be gone. | ||
=== To make the change permanent: === | ==== To make the change permanent: ==== | ||
1. Edit '''my.cnf''' file and under '''['''mysqld''']''' section change the ''max_connections'' value. | 1. Edit '''my.cnf''' file and under '''['''mysqld''']''' section change the ''max_connections'' value. | ||
Line 44: | Line 45: | ||
''IMPORTANT: Increasing the connections will also increase the memory usage on the server. Make sure you have enough resources before applying these changes. | '''IMPORTANT''': Increasing the connections will also increase the memory usage on the server. Make sure you have enough resources before applying these changes. | ||
Latest revision as of 22:54, 26 September 2019
MySQL error 1040: Too many connections
Problem
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.
Resolution
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.