View unanswered posts | View active topics It is currently Tue Sep 23, 2014 5:20 am



Reply to topic  [ 4 posts ] 
Can't connect MySQL server AND Can't call "prepare_cach 
Author Message

Joined: Sat Nov 20, 2004 2:12 am
Posts: 127
Post Can't connect MySQL server AND Can't call "prepare_cach
Hi

After a little over a year of flawless working with ZM suddenly this morning the Console showed up with a strange error (something about a MySql error, sorry didnt have the chance to copy/paste).

So after the "mandatory" reboot I found that ZM just didnt startup.

A "service zm start" at prompt gives out the following:

Code:
Starting ZoneMinder: DBI connect('database=zm;host=localhost','zm_admin',...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) at /usr/local/bin/zmpkg.pl line 49
Can't call method "prepare_cached" on an undefined value at /usr/local/bin/zmpkg.pl line 52.
BEGIN failed--compilation aborted at /usr/local/bin/zmpkg.pl line 60.


So what do you fellows think? Is there something I could try to do to fix what I think is a corrupt database or should I really be thinking on a reinstall :-(

I am not a MySql geek so I would appreciate on the appropiate commands if any to try on this.

I am running good old version 1.19.5 ZM here.

Regards!


Wed May 10, 2006 9:32 pm
Profile
User avatar

Joined: Fri Mar 05, 2004 5:47 pm
Posts: 5218
Location: /USA/Washington/Seattle
Post 
First check your mysql log and see why it is not starting. If the tables are corrupt you can try as outlined in this thread:
http://www.zoneminder.com/forums/viewtopic.php?t=5657
Otherwise we will need to know why mysql is not starting.

Regards,
Corey


Thu May 11, 2006 2:17 am
Profile WWW

Joined: Sat Nov 20, 2004 2:12 am
Posts: 127
Post 
Cordel

Thanks for your reply. I tried to use de mysqlcheck and myisamcheck first but it was a no go, on the first error 2002 and the second one error 30, something about the files being read only.

On that thread gessel posts he used the "e2fsck" command which I did once remember using on a linux which went bad because of an improper shutdown. I used it on this drive but did not use any switch. Lots of errors started to pop up and since I did not use any switch, confirmation had to be executed on every error found.

I am not going to kid here, there were so many errors expecting a "Yes" from the keyboard that after 2 hours I left the "Y" key on the keyboard pressed with a battery and a remote control and went to sleep :lol:

I know this was not the most elegant fix, and perhaps a switch could have helped on this one, but what matters is that I did find light at the end of the tunnel and ZM went live again.

I think this hard disk is really living on borrowed time but "e2fsck" got it up at least to work with it and make a backup.

Regards!


Thu May 11, 2006 3:02 pm
Profile
Site Admin
User avatar

Joined: Wed Jul 09, 2003 3:07 pm
Posts: 5221
Location: Bristol, UK
Post 
I hope you didn't run e2fsck on a mounted filesystem :shock:

There is a handy switch '-y' you can pass to e2fsck to auto answer yes to every question. Handy to know for next time :lol:

_________________
Phil


Fri May 12, 2006 12:11 pm
Profile ICQ YIM WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group