Page 1 of 1

Unable to connect to ZM db

Posted: Sat May 23, 2020 9:49 pm
by racelife
When I go my server webpage this is what I get:
Unable to connect to ZM db.SQLSTATE[HY000] [2002] No such file or directory

Not sure where to go from here...

I tried running zmupdate.pl as I had seen in another post but this is what I got:

WARNING: ZoneMinder configuration file found but is not readable. Check file permissions on /etc/zm/zm.conf
Use of uninitialized value $ZoneMinder::Config::Config{"ZM_DB_HOST"} in pattern match (m//) at /usr/share/perl5/ZoneMinder/Database.pm line 81.
Use of uninitialized value $ZoneMinder::Config::Config{"ZM_DB_HOST"} in concatenation (.) or string at /usr/share/perl5/ZoneMinder/Database.pm line 91.
Use of uninitialized value $ZoneMinder::Config::Config{"ZM_DB_NAME"} in concatenation (.) or string at /usr/share/perl5/ZoneMinder/Database.pm line 110.
DBI connect('database=;host=','',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /usr/share/perl5/ZoneMinder/Database.pm line 110.
Use of uninitialized value $ZoneMinder::Config::Config{"ZM_DB_HOST"} in pattern match (m//) at /usr/share/perl5/ZoneMinder/Database.pm line 81.
Use of uninitialized value $ZoneMinder::Config::Config{"ZM_DB_HOST"} in concatenation (.) or string at /usr/share/perl5/ZoneMinder/Database.pm line 91.
Use of uninitialized value $ZoneMinder::Config::Config{"ZM_DB_NAME"} in concatenation (.) or string at /usr/share/perl5/ZoneMinder/Database.pm line 110.
DBI connect('database=;host=','',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /usr/share/perl5/ZoneMinder/Database.pm line 110.
05/23/2020 15:33:07.209612 zmupdate[785].ERR [ZoneMinder::Database:113] [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) error val:]
05/23/2020 15:33:07.209935 zmupdate[785].ERR [ZoneMinder::Database:113] [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) error val:]
Use of uninitialized value $ZoneMinder::Config::Config{"ZM_DB_HOST"} in pattern match (m//) at /usr/share/perl5/ZoneMinder/Database.pm line 81.
Use of uninitialized value $ZoneMinder::Config::Config{"ZM_DB_HOST"} in concatenation (.) or string at /usr/share/perl5/ZoneMinder/Database.pm line 91.
Use of uninitialized value $ZoneMinder::Config::Config{"ZM_DB_NAME"} in concatenation (.) or string at /usr/share/perl5/ZoneMinder/Database.pm line 110.
DBI connect('database=;host=','',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /usr/share/perl5/ZoneMinder/Database.pm line 110.
05/23/2020 15:33:07.210445 zmupdate[785].ERR [ZoneMinder::Database:113] [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) error val:]
Can't call method "prepare_cached" on an undefined value at /usr/share/perl5/ZoneMinder/Config.pm line 96.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 147.
Compilation failed in require at /usr/bin/zmupdate.pl line 73.
BEGIN failed--compilation aborted at /usr/bin/zmupdate.pl line 73.

Re: Unable to connect to ZM db

Posted: Sun May 24, 2020 9:26 pm
by racelife
Sorry forgot to mention I'm on 1.35.4~20200515115321-bionic

Re: Unable to connect to ZM db

Posted: Mon May 25, 2020 4:55 pm
by rockedge
I think your problem is as simple as the wrong permissions are set for the ZM configuration directory /etc/zm!

insure that
/etc/zm
/var/cache/zoneminder
/var/log/zm

all are owned by the webserver and ZM user! In my case it is www-data most of the time

Code: Select all

chown -R www-data:www-data /etc/zm

Re: Unable to connect to ZM db

Posted: Wed May 27, 2020 11:27 pm
by racelife
I did sudo chown -R www-data:www-data /etc/zm and reboot but it didn't change anything.

Re: Unable to connect to ZM db

Posted: Thu May 28, 2020 1:38 am
by rockedge
is the mysql server running?

Re: Unable to connect to ZM db

Posted: Thu May 28, 2020 2:01 am
by racelife
I'm not sure... what is the command to see and start if needed?

Re: Unable to connect to ZM db

Posted: Sun May 31, 2020 6:00 am
by bkjaya1952

Re: Unable to connect to ZM db

Posted: Wed Jun 03, 2020 12:41 am
by racelife
bkjaya1952 wrote: Sun May 31, 2020 6:00 am Please try the procedure mentioned in this link below.

https://wiki.zoneminder.com/How_to_Inst ... cal_Fossa)




https://bkjaya.wordpress.com/2020/05/27 ... ker-image/
I'm not running 20.04 and this is not a new install. I'm not sure what procedure you are referring to. I'm on 18.04.4