(1.36.21)how can i init database

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
zafir
Posts: 2
Joined: Thu Jul 28, 2022 9:03 am

(1.36.21)how can i init database

Post by zafir »

i want to intall zominder 1.36.21 with remoting mysql.
but i do not know how can i init it
Ralphred
Posts: 32
Joined: Fri Jul 08, 2022 12:23 pm

Re: (1.36.21)how can i init database

Post by Ralphred »

You basically do it the normal way (redirecting the creation script into the mysql command) but from your DB client machine (your ZM server), or by copying the sql script to the the DB server and redirecting it locally.

For the "do it from the ZM server" way:
The only extra step is to create an 'admin' user for the host you will be connecting from, so from the DB Server machine

Code: Select all

$ mysql -u root -p
mysql> CREATE USER 'root'@'[zm server ip or hostname]' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'[zm server ip or hostname]' WITH GRANT OPTION;
Then when you run the install script command (or any other mysql command) on the ZM machine add the -h [host] switch

Code: Select all

$ mysql -h [zm server ip or hostname] -u root -p < /usr/share/zoneminder/db/zm_create.sql
For the "do it locally on the DB server" way:
On the DB server, copy the creation script locally and run it from there

Code: Select all

$ scp root@[zm server ip]:/usr/share/zoneminder/db/zm_create.sql ./
$ mysql -u root -p <./zm_create.sql
For both methods, when you add the zmuser to the database you have to use the @'[zm server ip or hostname]' instead of @'localhost' and also update the ZM_DB_HOST in your zm.conf.
zafir
Posts: 2
Joined: Thu Jul 28, 2022 9:03 am

Re: (1.36.21)how can i init database

Post by zafir »

Ralphred wrote: Thu Jul 28, 2022 1:13 pm You basically do it the normal way (redirecting the creation script into the mysql command) but from your DB client machine (your ZM server), or by copying the sql script to the the DB server and redirecting it locally.

For the "do it from the ZM server" way:
The only extra step is to create an 'admin' user for the host you will be connecting from, so from the DB Server machine

Code: Select all

$ mysql -u root -p
mysql> CREATE USER 'root'@'[zm server ip or hostname]' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'[zm server ip or hostname]' WITH GRANT OPTION;
Then when you run the install script command (or any other mysql command) on the ZM machine add the -h [host] switch

Code: Select all

$ mysql -h [zm server ip or hostname] -u root -p < /usr/share/zoneminder/db/zm_create.sql
For the "do it locally on the DB server" way:
On the DB server, copy the creation script locally and run it from there

Code: Select all

$ scp root@[zm server ip]:/usr/share/zoneminder/db/zm_create.sql ./
$ mysql -u root -p <./zm_create.sql
For both methods, when you add the zmuser to the database you have to use the @'[zm server ip or hostname]' instead of @'localhost' and also update the ZM_DB_HOST in your zm.conf.
sql file is in /usr/share/zoneminder/db after install ? i try it. :D
i only found zm_create.sql.in in github before
Nora563
Posts: 1
Joined: Wed Apr 19, 2023 7:19 am

Re: (1.36.21)how can i init database

Post by Nora563 »

Ralphred wrote: Thu Jul 28, 2022 1:13 pm You basically do it the normal way (redirecting the creation script into the mysql command) but from your DB client machine (your ZM server), or by copying the sql script to the the DB server and redirecting it locally.geometry dash bloodbath

For the "do it from the ZM server" way:
The only extra step is to create an 'admin' user for the host you will be connecting from, so from the DB Server machine

Code: Select all

$ mysql -u root -p
mysql> CREATE USER 'root'@'[zm server ip or hostname]' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'[zm server ip or hostname]' WITH GRANT OPTION;
Then when you run the install script command (or any other mysql command) on the ZM machine add the -h [host] switch

Code: Select all

$ mysql -h [zm server ip or hostname] -u root -p < /usr/share/zoneminder/db/zm_create.sql
For the "do it locally on the DB server" way:
On the DB server, copy the creation script locally and run it from there

Code: Select all

$ scp root@[zm server ip]:/usr/share/zoneminder/db/zm_create.sql ./
$ mysql -u root -p <./zm_create.sql
For both methods, when you add the zmuser to the database you have to use the @'[zm server ip or hostname]' instead of @'localhost' and also update the ZM_DB_HOST in your zm.conf.
It doesn't work. I tried it.
Post Reply