Page 1 of 1

PHP Errors after power failure (SOLVED)

Posted: Mon Jul 28, 2008 5:46 pm
by Beofres
After losing power briefly due to a tripped circuit, I logged into ZM fine but after logging in, the console has the following messages above it:

Code: Select all

Warning: mysql_query() [function.mysql-query]: Unable to save result set in /var/www/zm/zm_html_view_console.php on line 78
Table 'E' is marked as crashed and should be repaired
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/zm/zm_html_view_console.php on line 81

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/zm/zm_html_view_console.php on line 82

Warning: array_merge() [function.array-merge]: Argument #3 is not an array in /var/www/zm/zm_html_view_console.php on line 91
As you can see in the first message, a table is 'crashed'. How do I go about repairing it? What other checks can I do to fix the rest of the errors? Any advice would be greatly appreciated...

Running Ubuntu 7.04 and ZM 1.22.3 compiled using the Feisty 7.04 walkthrough by ktheking:

(http://www.zoneminder.com/forums/viewtopic.php?p=36524)

Posted: Mon Jul 28, 2008 7:00 pm
by cordel

Fixed!

Posted: Mon Jul 28, 2008 7:19 pm
by Beofres
Thanks. Running the following command:

Code: Select all

mysqlcheck --auto-repair --all-databases

...fixed my issue immediately. Thank you for the prompt response!

Posted: Mon Jul 28, 2008 8:01 pm
by coke
"MySQL Administrator" isn't a bad thing to have in your toolkit, also. Gives you a GUI to all of those options. It's part of the MySQL GUI Tools package, I believe. Free.

I've been tempted to add that command line version mentioned in the above post to the init scripts on my machine to avoid that problem in the future, but haven't gotten around to it.