When I run zm_create.sql -- "ERROR 1005 (HY000) at line 29: Can't create table 'zm.Config' (errno: -1)"

Forum for questions and support relating to the 1.29.x releases only.
Locked
eatkeylimepie
Posts: 4
Joined: Fri Oct 16, 2015 8:27 pm

When I run zm_create.sql -- "ERROR 1005 (HY000) at line 29: Can't create table 'zm.Config' (errno: -1)"

Post by eatkeylimepie »

My sql logs are not giving me much feedback for what is going wrong here, any suggestions?
bbunge
Posts: 2956
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: When I run zm_create.sql -- "ERROR 1005 (HY000) at line 29: Can't create table 'zm.Config' (errno: -1)"

Post by bbunge »

Linux and MySQL versions please...
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: When I run zm_create.sql -- "ERROR 1005 (HY000) at line 29: Can't create table 'zm.Config' (errno: -1)"

Post by SteveGilvarry »

Did you run it with an account with permissions to create tables? Check your readme for distro probably has some instructions to run it as -u root.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
eatkeylimepie
Posts: 4
Joined: Fri Oct 16, 2015 8:27 pm

Re: When I run zm_create.sql -- "ERROR 1005 (HY000) at line 29: Can't create table 'zm.Config' (errno: -1)"

Post by eatkeylimepie »

Yes, I am trying to run it with elevated permissions, this is the command I am using, it prompts for a password and the password is valid.

mysql -u root -p < /usr/share/zoneminder/db/zm_create.sql

I am on Ubuntu 14.04.4.

mysql Ver 14.14 Distrib 5.5.49, for debian-linux-gnu (x86_64) using readline 6.3

Thanks for the help!
bbunge
Posts: 2956
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: When I run zm_create.sql -- "ERROR 1005 (HY000) at line 29: Can't create table 'zm.Config' (errno: -1)"

Post by bbunge »

Well, it looks like your command is correct. You may want to try again using these instructions:
https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way

Might be best to reinstall Ubuntu and while you are at it use 16.04 with instructions for ZM here:
https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: When I run zm_create.sql -- "ERROR 1005 (HY000) at line 29: Can't create table 'zm.Config' (errno: -1)"

Post by knight-of-ni »

Googling reveals "can't create table errno: -1" is caused by corrupt sql tables. The corruption is such that you can just drop the table and recreate it, and you can't write over it... catch 22. The simplest approach may be to just apt-get purge mysql, manually go in and delete any leftover datbase files, and reinstall mysql, and create a new zoneminder database.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
Locked