How to install Zoneminder , ( v1.33.16.) with Mysql 8 on Ubuntu 19.10

Since the official Zoneminder eoan has Dependency wait on lgw01-amd64-051 , We will have to install Zoneminder disco  on Ubuntu 19.10.
There is a problem in the present PHP release which make errors with the “caching_sha2_password” introduced in the Mysql 8 by default .
Please refer the following link
https://www.php.net/manual/en/mysqli.requirements.php
Therefore , we will have to use “mysql_native_password” method in Mysql 8.
First of all we will have to install mysql-server-8 on Ubuntu 19.10 and enable mysql_native_password
The installation  of mysql-server-8.0 can be done using the synaptic package manager .



Figure:-1 Installed mysql-server-8 shown in synaptic package manager
Then open the Ubuntu terminal
sudo su

rm /etc/mysql/my.cnf

cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf

gedit /etc/mysql/my.cnf

Then enter the following line below [mysqld] on the opened my.cnf file and save the file

[mysqld]
default_authentication_plugin= mysql_native_password
Screenshot from 2020-01-04 00-20-27

Figure:-2  Amended  /etc/mysql/my.cnf
Then on the Ubuntu terminal

systemctl restart mysql
Then enter the following commands on the terminal to set root password for mysql server

 mysql

CREATE USER 'admin'@'localhost' IDENTIFIED WITH
mysql_native_password BY 'your password';

GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;

FLUSH PRIVILEGES ;

quit

systemctl restart mysql


Then install Zoneminder
The Zoneminder disco deb file is downloaded from https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder-master/+build/18492553/+files/zoneminder_1.33.16~20191229135312-disco_amd64.deb
GDebi Package Installer can be used to install the Zoneminder disco deb file
Before installing Zoneminder disco deb file to overcome dependency issues we will have to  download libmysqlclient20and install first  using the GDebi Package Installer.
Then install Zoneminder disco deb file that we have downloaded .
Creating user and zmpass
Open the Ubuntu terminal and enter  following 5 commands

sudo su

 mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
 
 
mysql
 
 CREATE USER 'zmuser'@localhost IDENTIFIED WITH mysql_native_password BY 'zmpass';
 
 GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION;
 
 FLUSH PRIVILEGES ;
 
quit 
 
 mysqladmin -uroot -p reload
 
 
 

Screenshot from 2020-01-03 22-17-43
Figure:-3  After coping mysql*.ini files from /usr/share/php7.3-mysql/mysql/
Screenshot from 2020-01-03 22-12-15
Figure:-4 mysql*.ini files in /usr/share/php7.3-mysql/mysql/
 
 
chmod 740 /etc/zm/zm.conf
 
 chown root:www-data /etc/zm/zm.conf
 
 adduser www-data video
 
 a2enmod cgi
 
a2enconf zoneminder
 
 a2enmod rewrite
 
 chown -R www-data:www-data /usr/share/zoneminder/
 
 systemctl enable zoneminder
 
 
 service zoneminder start
 Add timezone to PHP 
(  This step is not essential for Zoneminder 
1.33 as you can change the TIMEZONE later under Options/System/TIMEZONE )
 gedit /etc/php/7.3/apache2/php.ini
 
 
edit line 956 with your timezone
Then
sudo service apache2 reload Open zoneminder web console (http://localhost/zm/)

  Screenshot from 2020-01-03 22-31-41
Figure:-5 Zoneminder Console , after adding an Usb camera
 
 Note :-
In order to have  clean mysql-server-8.0 install , it is better to completely delete exiting mysql as follows 
sudo apt remove --purge mysql-server mysql-client mysql-common
sudo apt  autoremove
sudo apt autoclean 
 sudo rm -rf /etc/mysql
)

Comments

Popular posts from this blog

How to install ivms4200-linux docker image on Ubuntu 19.10 (eoan)

how to use bkjaya1952/smath-studio (a docker repository of SMath Studio-0.99.7030) on Ubuntu 19.10 (eoan)

A Solution to the installation problem of ZONEMINDER,v1.33.14.ON UBUNTU 19.10 (Eoan Ermine) using Mriadb instead of mysql-server-8.0