Unable to connect to ZM db.SQLSTATE[HY000] [2002] No such file or directory

Forum for questions and support relating to 1.35.x development only.
Post Reply
zmad34
Posts: 2
Joined: Wed Jun 17, 2020 1:18 pm

Unable to connect to ZM db.SQLSTATE[HY000] [2002] No such file or directory

Post by zmad34 » Wed Jun 17, 2020 1:24 pm

I have been using zoneminder for about a week.

My system Ubuntu Server 20.04 LTS

The server was shut down due to an intermediate electrical problem, and when I turned it on again, I was unable to connect the zoneminder.

When I try to go to http: // hostip / zm I get the following error:

Error Code on Web page: Unable to connect to ZM db.SQLSTATE[HY000] [2002] No such file or directory

can you help me ? please..

User avatar
iconnor
Posts: 1451
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Unable to connect to ZM db.SQLSTATE[HY000] [2002] No such file or directory

Post by iconnor » Wed Jun 17, 2020 2:25 pm

check into your mysql state.

systemctl status mysql
systemctl start mysql

if it won't start check error logs in /var/log/mysql/error.log

zmad34
Posts: 2
Joined: Wed Jun 17, 2020 1:18 pm

Re: Unable to connect to ZM db.SQLSTATE[HY000] [2002] No such file or directory

Post by zmad34 » Wed Jun 17, 2020 2:56 pm

I checked. There is such a log.

mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: deactivating (stop-sigterm) (Result: timeout)
Process: 2247 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 2258 (mysqld)
Status: "Server startup in progress"
Tasks: 20 (limit: 38372)
Memory: 323.1M
CGroup: /system.slice/mysql.service
└─2258 /usr/sbin/mysqld

Jun 17 17:37:40 shewarobitnvr systemd[1]: Starting MySQL Community Server...
Jun 17 17:47:40 shewarobitnvr systemd[1]: mysql.service: start operation timed out. Terminating.



LOG:
2020-06-16T21:24:46.720179Z 48541 [Warning] [MY-013360] [Server] Plugin sha256_password reported: ''sha256_password' is deprecated and will b>

~Rob
Posts: 9
Joined: Fri Jun 05, 2020 7:57 am

Re: Unable to connect to ZM db.SQLSTATE[HY000] [2002] No such file or directory

Post by ~Rob » Tue Jun 30, 2020 3:23 pm

I've had this a few times lately and the cause seems to be disk space.

Can you run

Code: Select all

df -h
?

Kiwijunglist
Posts: 3
Joined: Sat Jul 11, 2020 9:19 am

Re: Unable to connect to ZM db.SQLSTATE[HY000] [2002] No such file or directory

Post by Kiwijunglist » Sun Jan 10, 2021 5:05 am

I'm getting this error too, I'm using zoneminder docker - https://github.com/dlandon/zoneminder - which I've just discovered is now depreciated. I think the error relates to mysql server not running correctly.

User avatar
bkjaya1952
Posts: 150
Joined: Sat Aug 25, 2018 3:24 pm
Location: Sri Lanka
Contact:

Re: Unable to connect to ZM db.SQLSTATE[HY000] [2002] No such file or directory

Post by bkjaya1952 » Tue Jan 12, 2021 5:41 am

Kiwijunglist wrote:
Sun Jan 10, 2021 5:05 am
I'm getting this error too, I'm using zoneminder docker - https://github.com/dlandon/zoneminder - which I've just discovered is now depreciated. I think the error relates to mysql server not running correctly.
Please try the following

https://hub.docker.com/r/bkjaya1952/zon ... ker-latest

poohbah
Posts: 6
Joined: Sun Nov 15, 2020 10:11 pm

Re: Unable to connect to ZM db.SQLSTATE[HY000] [2002] No such file or directory

Post by poohbah » Sun Jan 17, 2021 8:24 pm

I'm running ZM in a container on Proxmox, but was having the exact same issue. I couldn't get the DB to work even after a reboot. Disk space was fine too. I ended up going into mysql error logs where I found this

2021-01-11 1:38:05 0 [ERROR] Bad magic header in tc log
2021-01-11 1:38:05 0 [ERROR] Crash recovery failed. Either correct the problem (if it's, for example, out of memory error) and restart, or delete tc log and start mysqld with --tc-heuristic-recover={commit|rollback}
2021-01-11 1:38:05 0 [ERROR] Can't init tc log
2021-01-11 1:38:05 0 [ERROR] Aborting

Upon doing some research into the tc log problem, I came upon this discussion:https://dba.stackexchange.com/questions ... nit-tc-log

The gist of it is to delete or mv the tc log. As soon as I did that, ZM came back to life. Now I just need to figure out why the tc log is causing this problem.

Hope this helps someone

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests