Can not create database

Support and queries relating to all previous versions of ZoneMinder
Locked
benlau
Posts: 7
Joined: Fri Mar 26, 2004 7:51 am

Can not create database

Post by benlau »

Hi all,

I have tried to install zm 1.19.1 or 1.19.0 , but it all got the same problem during installation. After I run `perl zmconfig.pl` and answered
a lot of questions. And then I tried to run `perl zmconfig.pl -noi ` to create the database. It was fail and complain that "Unknown database 'zm' " Ok , then i try to create the database 'zm' before running the command . This time it complain that zm.Config didn't created.

I am quite confused with it now. Becasue the user was granted all the privileges to it. It is able to create /drop /insert/delete the database 'zm'. I don't know why it was fail.

Thanks for any advise

That is the error message that zm is existed:

Loading config from 'zmconfig.txt'
Loading config from DB
DBD::mysql::st execute failed: Table 'zm.Config' doesn't exist at zmconfig.pl line 1484.
Can't execute: Table 'zm.Config' doesn't exist at zmconfig.pl line 1484.

That is the error message that zm is not existed:
Loading config from 'zmconfig.txt'
Loading config from DB
DBI connect('database=zm;host=localhost','elig',...) failed: Unknown database 'zm' at zmconfig.pl line 1468
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','elig',...) failed: Unknown database 'zm' at zmconfig.pl line 1372
Error: unable to save options to database: Unknown database 'zm'
Generating 'src/zm_config_defines.h'
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/zmx10.pl'
Processing 'scripts/zmpkg.pl'
Processing 'scripts/zmupdate.pl'
Processing 'scripts/zmvideo.pl'
Processing 'scripts/zm'
Processing 'db/zmschema.sql'
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: Can not create database

Post by zoneminder »

Hi Ben,

zmconfig.pl doesn't actually create the database for you. It generates a zmschema.sql file in the db directory which you can then use to create the database yourself. The details are in the README file but essentially you have to do something like

<i>mysql < db/zmschema.sql</i>

though you may have to give a username and password as well of a user on your system who has the privileges to create databases, this user would not normally be one of your ZM users by the way.

Phil,
benlau
Posts: 7
Joined: Fri Mar 26, 2004 7:51 am

Re: Can not create database

Post by benlau »

Hi Philip Coombes,

Thx!
benlau
Posts: 7
Joined: Fri Mar 26, 2004 7:51 am

Re: Can not create database

Post by benlau »

Hi Philip Coombes,

Thx!
Locked