grant create,index to zmuser when updating

pull/1157/head
Isaac Connor 2015-11-09 12:34:11 -05:00
parent 920bea8deb
commit 6b994132f1
1 changed files with 3 additions and 1 deletions

View File

@ -15,7 +15,7 @@ if [ "$1" = "configure" ]; then
# test if database if already present...
if ! $(echo quit | mysql --defaults-file=/etc/mysql/debian.cnf zm > /dev/null 2> /dev/null) ; then
cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/debian.cnf
echo 'grant lock tables, alter,select,insert,update,delete on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql
echo 'grant lock tables, alter,select,insert,update,delete,create,index on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql
fi
invoke-rc.d zoneminder stop || true
@ -47,6 +47,8 @@ if [ "$1" = "configure" ]; then
chown www-data:www-data -R /var/cache/zoneminder
else
chown www-data:www-data /var/log/zm
echo 'grant lock tables, create, index, alter on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysq
zmupdate.pl
fi
fi