Help with mysql crash on Ubuntu running zoneminder

Previous development branch now released as 1.36
Locked
CancunManny
Posts: 7
Joined: Fri Dec 13, 2019 2:37 am

Help with mysql crash on Ubuntu running zoneminder

Post by CancunManny »

Hello, I know this is probably not the best spot to ask this question since it is mostly ubuntu related, but perhaps one of you has ran onto this issue before and can point me on the right direction.

I am running ubuntu 18.04 desktop, with zoneminder on the background. In average my PC gets a power outage about once a month. More often than not there is no issue, but twice now after a power outage at reboot mysql won't start. Last time it happened I had to re install EVERYTHING (ubuntu and all) from scratch. Rather not have to do that again if possible. (This time I do plan to create backups so I can just restore from backup )

So basically everything was running great, power went out, and at reboot mysql won't start so ZM won't start either. If I try to remove mysql i get an error because of zoneminder. If I try to re install mysql same thing I get an error because of zm. I can't seem to "stop" ZM since it isn't running.

Any help would be greatly appreciated
CancunManny
Posts: 7
Joined: Fri Dec 13, 2019 2:37 am

Re: Help with mysql crash on Ubuntu running zoneminder

Post by CancunManny »

Bump
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Help with mysql crash on Ubuntu running zoneminder

Post by bbunge »

Your best bet is to invest in a UPS to avoid the crash when the power fails. Other than that you can do a backup of the MySQL databases and restore them after the power failure. You might also try Mariadb (recommended). I do not run a desktop version of Ubuntu and with that use Webmin to do the maintenance tasks. Might sound like overkill but it is a great tool to manage a database server. PHP MyAdmin also works well.
CancunManny
Posts: 7
Joined: Fri Dec 13, 2019 2:37 am

Re: Help with mysql crash on Ubuntu running zoneminder

Post by CancunManny »

Thank you. Yes I know a decent UPS would be a good solution, but at the time (because of income problems) that is not an issue.

The issue seems to be with the sql server (if that is the right name). I can't remove it to do a clean install.
SkippyDo
Posts: 221
Joined: Mon Nov 20, 2017 6:49 pm

Re: Help with mysql crash on Ubuntu running zoneminder

Post by SkippyDo »

You have to identify WHY the database server isn't starting. Most probable reason is that databases are corrupted. If so then there's no reason to uninstall anything: rather, it's about wiping out the database and rebuilding with a backup.

When I was planning for my ZM system I had a UPS budgeted in from the get-go: I live out in the country, power outages are a fact of life; it's not just power outages but also voltage fluctuations that one has to protect against/for. This is basic stuff if one is serious about uptime.

I totally empathize with the desire to not have to install from scratch. Just got done doing that after upgrading my OS and ZM, after running 1.30.4 for several years: in my case my database backups didn't work out for me.
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: Help with mysql crash on Ubuntu running zoneminder

Post by burger »

Is there any evidence that db corruptions are more frequent on ZM > 1.32?
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
Locked