Page 1 of 1

(1.36.21)how can i init database

Posted: Thu Jul 28, 2022 9:30 am
by zafir
i want to intall zominder 1.36.21 with remoting mysql.
but i do not know how can i init it

Re: (1.36.21)how can i init database

Posted: Thu Jul 28, 2022 1:13 pm
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.

Re: (1.36.21)how can i init database

Posted: Fri Jul 29, 2022 1:42 am
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

Re: (1.36.21)how can i init database

Posted: Wed Apr 19, 2023 7:21 am
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.