fix: innodbconfig, disablet mysql timezone change

innodb configuration from official guide Debian 10 Buster with Zoneminder 1.36.x from ZM Repo
This commit is contained in:
Nardo86 2022-08-08 15:38:20 +02:00 committed by GitHub
parent 70ca9d3e2f
commit 67b2a52134
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 11 deletions

View File

@ -11,6 +11,9 @@ else
echo "MariaDBPath already configured" echo "MariaDBPath already configured"
fi fi
sed -i -e 's,/var/lib/mysql,/config/mysql,g' /etc/mysql/mariadb.conf.d/50-server.cnf sed -i -e 's,/var/lib/mysql,/config/mysql,g' /etc/mysql/mariadb.conf.d/50-server.cnf
echo 'innodb_file_per_table = ON' >> /etc/mysql/mariadb.conf.d/50-server.cnf
echo 'innodb_buffer_pool_size = 256M' >> /etc/mysql/mariadb.conf.d/50-server.cnf
echo 'innodb_log_file_size = 32M' >> /etc/mysql/mariadb.conf.d/50-server.cnf
echo "Check MariaDB config" echo "Check MariaDB config"
/etc/init.d/mysql start /etc/init.d/mysql start
@ -53,17 +56,17 @@ else
echo "MariaDB already configured" echo "MariaDB already configured"
fi fi
echo "Checking Timezones" #echo "Checking Timezones"
RESULT=$(cat /etc/mysql/my.cnf| grep default-time-zone) #RESULT=$(cat /etc/mysql/my.cnf| grep default-time-zone)
if [ "$RESULT" != "default-time-zone=$(cat /etc/timezone)" ]; then #if [ "$RESULT" != "default-time-zone=$(cat /etc/timezone)" ]; then
echo "Set Mysql timezone" # echo "Set Mysql timezone"
printf "[mysqld]\n default-time-zone=$(cat /etc/timezone)" >> /etc/mysql/my.cnf # printf "[mysqld]\n default-time-zone=$(cat /etc/timezone)" >> /etc/mysql/my.cnf
/etc/init.d/mysql restart # /etc/init.d/mysql restart
while ! mysqladmin ping --silent; do # while ! mysqladmin ping --silent; do
echo "Waiting mysql restart..." # echo "Waiting mysql restart..."
sleep 3 # sleep 3
done # done
fi #fi
RESULT=$(cat /etc/php/*/apache2/php.ini| grep "date.timezone =") RESULT=$(cat /etc/php/*/apache2/php.ini| grep "date.timezone =")
if [ "$RESULT" != "date.timezone = $(sed 's/\\/\//' /etc/timezone)" ]; then if [ "$RESULT" != "date.timezone = $(sed 's/\\/\//' /etc/timezone)" ]; then