Can't connect to local MySQL server through socket '/tmp/mysql.sock'
Posted: Wed Jun 22, 2022 1:34 am
New install FreeBSD 13.1, ZM 1.36.12 & MySQL 5.7; ZM seems to be working correctly, the cameras display images; I have manually connected to MySQL with -u zmuser -p dozens of times without fail; I have no idea how to fix this and it seems I'm the only person in the world having this problem.
However, I'm getting hundreds of errors connecting to MySQL:
zmwatch[2303].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) error val:]
DBD::mysql::db ping failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61) at /usr/local/bin/zmwatch.pl line 88.
DBI connect('database=zm;host=localhost','zmuser',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.
zmstats[2314].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) error val:]
06/21/22 18:58:07.319295 zmstats[2314].INF [main:47] [Reconnecting to db]
zmfilter_1[4059]: ERR [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) error val:]
zmc_m3[4218]: ERR [zmc_m3] [Can't run query INSERT INTO `Logs` ( `TimeKey`, `Component`, `ServerId`, `Pid`, `Level`, `Code`, `Message`, `File`, `Line` ) VALUES ( 1655859659.881583, 'zmc_m3', 0, 100680, 0, 'INF', 'Driveway: image_count:7335 - Closing event 234, shutting down', 'zm_monitor.cpp', 3121 ): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)]
zmc_m3[4218]: ERR [zmc_m3] [Can't run query INSERT INTO Monitor_Status (MonitorId,Status,CaptureFPS,AnalysisFPS) VALUES (3, 'Running',0,0) ON DUPLICATE KEY UPDATE Status='Running',CaptureFPS=0,AnalysisFPS=0: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)]
However, I'm getting hundreds of errors connecting to MySQL:
zmwatch[2303].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) error val:]
DBD::mysql::db ping failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61) at /usr/local/bin/zmwatch.pl line 88.
DBI connect('database=zm;host=localhost','zmuser',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.
zmstats[2314].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) error val:]
06/21/22 18:58:07.319295 zmstats[2314].INF [main:47] [Reconnecting to db]
zmfilter_1[4059]: ERR [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) error val:]
zmc_m3[4218]: ERR [zmc_m3] [Can't run query INSERT INTO `Logs` ( `TimeKey`, `Component`, `ServerId`, `Pid`, `Level`, `Code`, `Message`, `File`, `Line` ) VALUES ( 1655859659.881583, 'zmc_m3', 0, 100680, 0, 'INF', 'Driveway: image_count:7335 - Closing event 234, shutting down', 'zm_monitor.cpp', 3121 ): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)]
zmc_m3[4218]: ERR [zmc_m3] [Can't run query INSERT INTO Monitor_Status (MonitorId,Status,CaptureFPS,AnalysisFPS) VALUES (3, 'Running',0,0) ON DUPLICATE KEY UPDATE Status='Running',CaptureFPS=0,AnalysisFPS=0: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)]