Hi,
After changing the function of my 36 cameras to "modect" zoneminder's state suddenly changed from running to stopped, I restarted zoneminder and refreshed the ZM-Console webpage and got the following error " Unable to connect to ZM db.SQLSTATE[08004] [1040] Too many connections ".
When I restarted Zonminder with "sudo systemctl restart zoneminder" and I got the following error "Can't connect to database: Access denied for user 'apache@localhost' (using password:YES)"
Can anyone please help me sort this out?
Thanks.
Unable to connect to ZM db.SQLSTATE[08004] [1040] Too many connections
-
- Posts: 20
- Joined: Fri Jul 13, 2018 1:45 am
Re: Unable to connect to ZM db.SQLSTATE[08004] [1040] Too many connections
mysql server is running? have you restarted the mysql? see if ZM can connect? has anything happen to the /etc/zm/zm.conf file?
does ZM start with 36 cams in "monitor" mode? can you select 1 or 2 cams for modect and does that work?
does ZM start with 36 cams in "monitor" mode? can you select 1 or 2 cams for modect and does that work?
-
- Posts: 20
- Joined: Fri Jul 13, 2018 1:45 am
Re: Unable to connect to ZM db.SQLSTATE[08004] [1040] Too many connections
zm.conf is present, I opened it with VI and read it, I don't see anything obviously wrong with it.
I was able to get zoneminder running again by changing 13 of my cameras to monitor instead of motion detect. I still need to know what I need to do so that I can use motion detection on all of the cameras.
I saw some posts from older versions of zoneminder where people had run into the "too many connections error" but the configuration files for mysql / mariadb don't seem to be in the places indicated in those posts. Can anyone tell me how to increase the number of connections to the mysql database so that I can record on all 36 cameras?
I was able to get zoneminder running again by changing 13 of my cameras to monitor instead of motion detect. I still need to know what I need to do so that I can use motion detection on all of the cameras.
I saw some posts from older versions of zoneminder where people had run into the "too many connections error" but the configuration files for mysql / mariadb don't seem to be in the places indicated in those posts. Can anyone tell me how to increase the number of connections to the mysql database so that I can record on all 36 cameras?
Re: Unable to connect to ZM db.SQLSTATE[08004] [1040] Too many connections
Linux distro and version? MYSQL or Mariadb?
You can add the setting to the /etc/my.cnf
[mysqld]
max_connections=1000
Restart mysql or mariadb
Run mysqltuner every few days to see where you need to make changes.
You can add the setting to the /etc/my.cnf
[mysqld]
max_connections=1000
Restart mysql or mariadb
Run mysqltuner every few days to see where you need to make changes.
-
- Posts: 20
- Joined: Fri Jul 13, 2018 1:45 am
Re: Unable to connect to ZM db.SQLSTATE[08004] [1040] Too many connections
CentOS 7 and Mariadb 5.5.56.
I do not have a file located at /etc/my.cnf. I do have a /etc/my.con.d folder but I dont think that is the right thing. I'm assuming there is no my.cnf because I have mariadb? or do I need to create a my.cnf file?
I do not have a file located at /etc/my.cnf. I do have a /etc/my.con.d folder but I dont think that is the right thing. I'm assuming there is no my.cnf because I have mariadb? or do I need to create a my.cnf file?
Re: Unable to connect to ZM db.SQLSTATE[08004] [1040] Too many connections
Wherever the config file for mariadb is add the max connections line.
-
- Posts: 20
- Joined: Fri Jul 13, 2018 1:45 am
Re: Unable to connect to ZM db.SQLSTATE[08004] [1040] Too many connections
I ended up just creating a configuration file at /etc/my.cnf. I set the max connections in the my.cnf to 2000, but when I check the max connections in mysql it shows 1190, what do I need to do to get the connections to actually reflect the settings in the my.cnf file?