Page 1 of 1

Table 'zm.Config' doesn't exist

Posted: Tue Jun 21, 2005 8:33 am
by Blazer
I'm working on my ZM config, and I ran the "perl zmconfig.pl" script and answered all the questions (boy there was a lot of them!). Aftwards as instructed I ran "perl zmconfig.pl -noi", and i get the following output:

Code: Select all

[root@zoneminder zm-1.21.1]# perl zmconfig.pl -noi
Loading config from 'zmconfig.txt'
Loading config from DB
DBI connect('database=zm;host=localhost','zm',...) failed: Unknown database 'zm' at zmconfig.pl line 1662
Error: unable to load options from database: Unknown database 'zm'
Saving config to 'zmconfig.txt'
Saving config to DB
DBI connect('database=zm;host=localhost','zm',...) failed: Unknown database 'zm' at zmconfig.pl line 1566
Error: unable to save options to database: Unknown database 'zm'
Generating 'src/zm_config_defines.h'
Processing 'zm.conf'
Processing 'src/zm_config.h'
Processing 'web/zm_config.php'
Processing 'scripts/zmdc.pl'
Processing 'scripts/zmwatch.pl'
Processing 'scripts/zmaudit.pl'
Processing 'scripts/zmfilter.pl'
Processing 'scripts/zmtrigger.pl'
Processing 'scripts/zmx10.pl'
Processing 'scripts/zmpkg.pl'
Processing 'scripts/zmupdate.pl'
Processing 'scripts/zmvideo.pl'
Processing 'scripts/zmcontrol-pelco-d.pl'
Processing 'scripts/zmcontrol-pelco-p.pl'
Processing 'scripts/zmcontrol-visca.pl'
Processing 'scripts/zmcontrol-kx-hcm10.pl'
Processing 'scripts/zmcontrol-axis-v2.pl'
Processing 'scripts/zmtrack.pl'
Processing 'scripts/zm'
Processing 'db/zmschema.sql'
Here is my current database layout:

Code: Select all

[root@zoneminder zm-1.21.1]# mysql -u zm -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 107 to server version: 4.1.12-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+----------+
| Database |
+----------+
| mysql    |
| test     |
+----------+
2 rows in set (0.00 sec)
So indeed there is no "zm" database (I configured it to use "zm" as a database, with a user called "zm"). I tried creating the database manually, giving the zm user full perms to it, but then it complains about missing tables:

Code: Select all

[root@zoneminder zm-1.21.1]# perl zmconfig.pl -noi
Loading config from 'zmconfig.txt'
Loading config from DB
DBD::mysql::st execute failed: Table 'zm.Config' doesn't exist at zmconfig.pl line 1678.
Can't execute: Table 'zm.Config' doesn't exist at zmconfig.pl line 1678.
I'm sure there is a simple fix or something I am doing wrong...any pointers would be much appreciated.

Did you do...

Posted: Tue Jun 21, 2005 1:30 pm
by Baylink
that step about "mysql ... db/zmschema.sql"?

(BTW, Phil, for some reason, the doco seems not to mention the "db/" part, though every time I've gotten to that step, that was where I was not. Did the location of the populate script get changed, and the manual didn't keep up?)

Posted: Tue Jun 21, 2005 9:06 pm
by Blazer
Taking a hint from your reply, I figured out that I needed to manually import the schema.

This created the zm database schema and I was then able to run zmconfig without any errors:

Code: Select all

[root@zoneminder db]# mysql -u zm -p <zmschema.sql
Enter password:

[root@zoneminder db]# cd ..
[root@zoneminder zm-1.21.1]# perl zmconfig.pl -noi
Loading config from 'zmconfig.txt'
Loading config from DB
Saving config to 'zmconfig.txt'
Saving config to DB
Generating 'src/zm_config_defines.h'
Processing 'zm.conf'
Processing 'src/zm_config.h'
Processing 'web/zm_config.php'
Processing 'scripts/zmdc.pl'
Processing 'scripts/zmwatch.pl'
Processing 'scripts/zmaudit.pl'
Processing 'scripts/zmfilter.pl'
Processing 'scripts/zmtrigger.pl'
Processing 'scripts/zmx10.pl'
Processing 'scripts/zmpkg.pl'
Processing 'scripts/zmupdate.pl'
Processing 'scripts/zmvideo.pl'
Processing 'scripts/zmcontrol-pelco-d.pl'
Processing 'scripts/zmcontrol-pelco-p.pl'
Processing 'scripts/zmcontrol-visca.pl'
Processing 'scripts/zmcontrol-kx-hcm10.pl'
Processing 'scripts/zmcontrol-axis-v2.pl'
Processing 'scripts/zmtrack.pl'
Processing 'scripts/zm'
Processing 'db/zmschema.sql'
[root@zoneminder zm-1.21.1]#