Update 'mysql-5.7.sh'

This commit is contained in:
bprieshof
2019-07-11 13:40:18 +02:00
parent c99ab90c58
commit 087aabd322

View File

@@ -8,7 +8,6 @@ phpmyadminver=4.9.0.1
# MySQL #
##------------##
apt install -y mysql-server
mysqladmin -u root password "$password"
mysql -u root -p"$password" -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')"
@@ -23,22 +22,26 @@ mysql -u root -p"$password" -e "SELECT user,authentication_string,plugin,host FR
# PHPMyAdmin #
##----------------##
debconf-set-selections <<< "phpmyadmin phpmyadmin/dbconfig-install boolean true"
debconf-set-selections <<< "phpmyadmin phpmyadmin/app-password-confirm password $password"
debconf-set-selections <<< "phpmyadmin phpmyadmin/mysql/admin-pass password $password"
debconf-set-selections <<< "phpmyadmin phpmyadmin/mysql/app-pass password $passsword"
debconf-set-selections <<< "phpmyadmin phpmyadmin/reconfigure-webserver multiselect"
apt install -y phpmyadmin
a2disconf phpmyadmin
ln -s /usr/share/phpmyadmin /var/www/"$domain"/database
cd /tmp
mkdir /usr/share/phpmyadmin/
mkdir /etc/phpmyadmin
mkdir -p /usr/share/phpmyadmin/
mkdir -p /etc/phpmyadmin
mkdir -p /var/lib/phpmyadmin/tmp/
wget https://files.phpmyadmin.net/phpMyAdmin/$phpmyadminver/phpMyAdmin-$phpmyadminver-all-languages.tar.gz
tar xzf phpMyAdmin-$phpmyadminver-all-languages.tar.gz
mv phpMyAdmin-$phpmyadminver-all-languages/* /usr/share/phpmyadmin
wget https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Web/raw/branch/master/config/phpmyadmin/vendor_config.php -O /usr/share/phpmyadmin/libraries/vendor_config.php
wget https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Web/raw/branch/master/config/phpmyadmin/config.footer.inc.php -O /etc/phpmyadmin/config.footer.inc.php
wget https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Web/raw/branch/master/config/phpmyadmin/config.header.inc.php -O /etc/phpmyadmin/config.header.inc.php
wget https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Web/raw/branch/master/config/phpmyadmin/config.inc.php -O /etc/phpmyadmin/config.inc.php
touch /var/lib/phpmyadmin/config.inc.php
touch /etc/phpmyadmin/config-db.php
chown -R www-data:www-data /var/lib/phpmyadmin/
blowsec=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
echo -e "<?php\n\n\$cfg['blowfish_secret'] = '$blowsec';\n\n?>" >> /var/lib/phpmyadmin/blowfish_secret.inc.php
mysql -u root --password="$password" < /usr/share/phpmyadmin/sql/create_tables.sql
ln -s /usr/share/phpmyadmin /var/www/"$domain"/database