Zoneminder 1.32.1 running on Ubuntu 16.04.5. Never had this issue before. max_connections was commented out in /etc/mysql/my.cnf.
I stopped zoneminder, set it to 200 and restarted mysql and zoneminder just to be on the safe side. Hoping that's the end of it.
Unable to connect to ZM db.SQLSTATE[HY000] [1040] Too many connections
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: Unable to connect to ZM db.SQLSTATE[HY000] [1040] Too many connections
The zoneminder navbar tells you how many connections there are currently and what your max is. You should keep an eye on that.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
All of these can be found at https://zoneminder.blogspot.com/
Re: Unable to connect to ZM db.SQLSTATE[HY000] [1040] Too many connections
After running the server for a few more weeks I started seeing this again. Even after changing max_connections to 1000 in my.cnf.
Zoneminder was upgraded to 1.32.2
my.cnf
max_connections = 1000
mysql> show status like '%onn%';
+-----------------------------------------------+---------------------+
| Variable_name | Value |
+-----------------------------------------------+---------------------+
| Aborted_connects | 123001 |
| Connection_errors_accept | 0 |
| Connection_errors_internal | 0 |
| Connection_errors_max_connections | 123232 |
| Connection_errors_peer_address | 0 |
| Connection_errors_select | 0 |
| Connection_errors_tcpwrap | 0 |
| Connections | 127805 |
| Locked_connects | 0 |
| Max_used_connections | 215 |
| Max_used_connections_time | 2018-10-28 08:17:47 |
| Performance_schema_session_connect_attrs_lost | 0 |
| Ssl_client_connects | 0 |
| Ssl_connect_renegotiates | 0 |
| Ssl_finished_connects | 0 |
| Threads_connected | 215 |
+-----------------------------------------------+---------------------+
16 rows in set (0.17 sec)
Zoneminder was upgraded to 1.32.2
my.cnf
max_connections = 1000
mysql> show status like '%onn%';
+-----------------------------------------------+---------------------+
| Variable_name | Value |
+-----------------------------------------------+---------------------+
| Aborted_connects | 123001 |
| Connection_errors_accept | 0 |
| Connection_errors_internal | 0 |
| Connection_errors_max_connections | 123232 |
| Connection_errors_peer_address | 0 |
| Connection_errors_select | 0 |
| Connection_errors_tcpwrap | 0 |
| Connections | 127805 |
| Locked_connects | 0 |
| Max_used_connections | 215 |
| Max_used_connections_time | 2018-10-28 08:17:47 |
| Performance_schema_session_connect_attrs_lost | 0 |
| Ssl_client_connects | 0 |
| Ssl_connect_renegotiates | 0 |
| Ssl_finished_connects | 0 |
| Threads_connected | 215 |
+-----------------------------------------------+---------------------+
16 rows in set (0.17 sec)
Re: Unable to connect to ZM db.SQLSTATE[HY000] [1040] Too many connections
Whilst its good to see the status - what help is it to the user?knight-of-ni wrote: ↑Sun Oct 14, 2018 12:40 pm The zoneminder navbar tells you how many connections there are currently and what your max is. You should keep an eye on that.
What can the user actually do (other than add _a lot_ of cameras) that would affect this?
I think this should be something that should be kept in-check internally?